linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Toralf Förster" <toralf.foerster@gmx.de>
To: linux-nfs@vger.kernel.org
Cc: "Toralf Förster" <toralf.foerster@gmx.de>
Subject: [PATCH] fs/nfs/idmap.c: fix a Memory leak for variable desc
Date: Sat, 26 Apr 2014 21:55:57 +0200	[thread overview]
Message-ID: <1398542157-20159-1-git-send-email-toralf.foerster@gmx.de> (raw)

Signed-off-by: Toralf Förster <toralf.foerster@gmx.de>
---
 fs/nfs/idmap.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c
index 567983d..8eb4954 100644
--- a/fs/nfs/idmap.c
+++ b/fs/nfs/idmap.c
@@ -272,8 +272,10 @@ static struct key *nfs_idmap_request_key(const char *name, size_t namelen,
 	ssize_t ret;
 
 	ret = nfs_idmap_get_desc(name, namelen, type, strlen(type), &desc);
-	if (ret <= 0)
+	if (ret <= 0) {
+		kfree(desc);
 		return ERR_PTR(ret);
+	}
 
 	rkey = request_key(&key_type_id_resolver, desc, "");
 	if (IS_ERR(rkey)) {
-- 
1.9.2


             reply	other threads:[~2014-04-26 19:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-26 19:55 Toralf Förster [this message]
2014-04-27  0:10 ` [PATCH] fs/nfs/idmap.c: fix a Memory leak for variable desc Trond Myklebust
2014-04-27  8:34   ` Toralf Förster

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=1398542157-20159-1-git-send-email-toralf.foerster@gmx.de \
    --to=toralf.foerster@gmx.de \
    --cc=linux-nfs@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).