text-based mount.nfs: Fix memory leak in add_mtab()
Subsystems (2)
PATCH 4/14 text-based mount.nfs: Fix memory leak in add_mtab()
The add_mtab() function in utils/mount/mount.c calls fix_opts_string() to construct an /etc/mtab entry, but never frees the result.
Signed-off-by Chuck Lever <[email protected]>
---
utils/mount/mount.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
utils/mount/mount.c +2 -0
@@ -237,6 +237,7 @@ static int add_mtab(char *spec, char *mount_point, char *fstype,if (flags &MS_REMOUNT ) {update_mtab (ment.mnt_dir, &ment); +free (ment.mnt_opts);return EX_SUCCESS ; }
@@ -267,6 +268,7 @@ fail_close:endmntent (mtab); fail_unlock:unlock_mtab (); +free (ment.mnt_opts);return result; }
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs