Page MenuHomeFreeBSD

Fix memory leak in mount
Needs RevisionPublic

Authored by trix_juniper.net on Mar 20 2017, 3:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jan 11, 2:45 PM
Unknown Object (File)
Fri, Jan 10, 5:35 AM
Unknown Object (File)
Tue, Jan 7, 11:55 PM
Unknown Object (File)
Jan 1 2025, 4:44 PM
Unknown Object (File)
Dec 25 2024, 8:03 PM
Unknown Object (File)
Dec 22 2024, 4:50 PM
Unknown Object (File)
Nov 1 2024, 3:33 AM
Unknown Object (File)
Oct 11 2024, 12:23 AM
Subscribers

Details

Reviewers
rodrigc
cem
Summary

getmntopts.c build_iovec_argf
Introduce a new variable 'sval' to hold memory allocated with strdup and to free it when unused.

Test Plan

Use clang's static analyzer, scan-build, to find the problem and later to show resolution.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Please upload diffs with context. (Either use diff -U999999 and upload, or use the arc tool associated with Phabricator.)

cem requested changes to this revision.Mar 20 2017, 4:22 PM

This change is bogus. The strdup() memory is owned by the iov structure (iov_base in build_iovec()) and needed by callers. Callers will later free the memory via free_iovec().

This revision now requires changes to proceed.Mar 20 2017, 4:22 PM