diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2010-10-28 13:10:48 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2010-11-01 08:05:14 -0400 |
commit | bc4a0c42570d5620cc1bb32428e16b9c9b5f3863 (patch) | |
tree | f3e9bdfec747c416d401f1c60436049816e29f86 /utils/mount/stropts.c | |
parent | 1f237ac72e6f563908b350e11fd2bb866c003028 (diff) | |
download | nfs-utils-bc4a0c42570d5620cc1bb32428e16b9c9b5f3863.tar.gz nfs-utils-bc4a0c42570d5620cc1bb32428e16b9c9b5f3863.tar.xz nfs-utils-bc4a0c42570d5620cc1bb32428e16b9c9b5f3863.zip |
mount.nfs: Fix memory leak in nfs_sys_mount()
This appears to have been left behind by last year's adjustments to
how the extra_opts string is constructed.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/mount/stropts.c')
-rw-r--r-- | utils/mount/stropts.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c index 29b1aaa..ac81616 100644 --- a/utils/mount/stropts.c +++ b/utils/mount/stropts.c @@ -568,16 +568,18 @@ static int nfs_sys_mount(struct nfsmount_info *mi, struct mount_options *opts) char *options = NULL; int result; + if (mi->fake) + return 1; + if (po_join(opts, &options) == PO_FAILED) { errno = EIO; return 0; } - if (mi->fake) - return 1; - result = mount(mi->spec, mi->node, mi->type, mi->flags & ~(MS_USER|MS_USERS), options); + free(options); + if (verbose && result) { int save = errno; nfs_error(_("%s: mount(2): %s"), progname, strerror(save)); |