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
F81589046: D10062.diff
Thu, Apr 18, 2:17 PM
Unknown Object (File)
Mar 15 2024, 9:24 AM
Unknown Object (File)
Jan 30 2024, 7:40 PM
Unknown Object (File)
Dec 25 2023, 1:48 PM
Unknown Object (File)
Dec 20 2023, 12:42 AM
Unknown Object (File)
Dec 13 2023, 6:27 AM
Unknown Object (File)
Dec 10 2023, 6:42 AM
Unknown Object (File)
Nov 29 2023, 7:30 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