public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: steved@redhat.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 2/2] mount: Fix po_join() call site in nfs_try_mount_v4()
Date: Mon, 26 Oct 2009 17:03:27 -0400	[thread overview]
Message-ID: <20091026210327.14346.15937.stgit@matisse.1015granger.net> (raw)
In-Reply-To: <20091026210110.14346.90636.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>

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

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

 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);


  parent reply	other threads:[~2009-10-26 21:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-26 21:03 [PATCH 0/2] Two short pieces for nfs-utils Chuck Lever
     [not found] ` <20091026210110.14346.90636.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
2009-10-26 21:03   ` [PATCH 1/2] mount.nfs: Assume v2/v3 if mount-related options are present Chuck Lever
     [not found]     ` <20091026210319.14346.20494.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
2009-11-03 17:55       ` Steve Dickson
2009-10-26 21:03   ` Chuck Lever [this message]
     [not found]     ` <20091026210327.14346.15937.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
2009-11-03 17:56       ` [PATCH 2/2] mount: Fix po_join() call site in nfs_try_mount_v4() Steve Dickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091026210327.14346.15937.stgit@matisse.1015granger.net \
    --to=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox