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
F106125997: D10062.diff
Wed, Dec 25, 8:03 PM
Unknown Object (File)
Sun, Dec 22, 4:50 PM
Unknown Object (File)
Nov 1 2024, 3:33 AM
Unknown Object (File)
Oct 11 2024, 12:23 AM
Unknown Object (File)
Oct 4 2024, 9:31 AM
Unknown Object (File)
Oct 3 2024, 2:30 PM
Unknown Object (File)
Oct 1 2024, 4:12 PM
Unknown Object (File)
Sep 29 2024, 2:31 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