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)
Tue, Mar 3, 1:13 PM
Unknown Object (File)
Tue, Mar 3, 9:03 AM
Unknown Object (File)
Tue, Mar 3, 2:54 AM
Unknown Object (File)
Fri, Feb 27, 1:33 AM
Unknown Object (File)
Sun, Feb 22, 9:19 PM
Unknown Object (File)
Sat, Feb 21, 10:17 PM
Unknown Object (File)
Sat, Feb 21, 10:17 PM
Unknown Object (File)
Fri, Feb 20, 2:46 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