[PATCH 2/2] mount: Fix po_join() call site in nfs_try_mount_v4()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make sure the copied options string is freed in case po_join() fails.

Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
---

 utils/mount/stropts.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index 0f1061c..2d74a54 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -605,12 +605,13 @@ static int nfs_try_mount_v4(struct nfsmount_info *mi)
 		errno = EINVAL;
 		goto out_fail;
 	}
+
 	/*
 	 * Update option string to be recorded in /etc/mtab.
 	 */
 	if (po_join(options, mi->extra_opts) == PO_FAILED) {
 		errno = ENOMEM;
-		return 0;
+		goto out_fail;
 	}
 
 	result = nfs_sys_mount(mi, options);

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux