diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2007-09-24 11:28:44 -0400 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2007-09-25 11:50:15 +1000 |
commit | d97d88b288413b4e528e22739bfb08594efe9940 (patch) | |
tree | 792c8940137a9b68cfc3f0d7e4be67f318f6fa24 /utils/mount/mount.c | |
parent | 51a4d2330b078dcd111d05e6c00753780b0e90a3 (diff) | |
download | nfs-utils-d97d88b288413b4e528e22739bfb08594efe9940.tar.gz nfs-utils-d97d88b288413b4e528e22739bfb08594efe9940.tar.xz nfs-utils-d97d88b288413b4e528e22739bfb08594efe9940.zip |
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 <chuck.lever@oracle.com>
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'utils/mount/mount.c')
-rw-r--r-- | utils/mount/mount.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/utils/mount/mount.c b/utils/mount/mount.c index 751fbb9..31e1969 100644 --- a/utils/mount/mount.c +++ b/utils/mount/mount.c @@ -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; } |