From 97731f394c6b83ed7e5c3923278bbe98ee130bee Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Tue, 3 Nov 2009 11:19:08 -0500 Subject: [PATCH] mount: Fix po_join() call site in nfs_try_mount_v4() Make sure the copied options string is freed in case po_join() fails. Signed-off-by: Chuck Lever Signed-off-by: Steve Dickson --- utils/mount/stropts.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c index 4c9ee17..b595649 100644 --- a/utils/mount/stropts.c +++ b/utils/mount/stropts.c @@ -621,12 +621,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); -- 2.39.2