All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Drokin <green@namesys.com>
To: trond.myklebust@fys.uio.no, torvalds@transmeta.com,
	linux-kernel@vger.kernel.org
Subject: [2.5] memleak in fs/nfs/inode.c::nfs_get_sb()
Date: Tue, 11 Mar 2003 18:11:05 +0300	[thread overview]
Message-ID: <20030311181105.A3232@namesys.com> (raw)

Hello!

   There is trivial memleak on error exit path in nfs get_sb function.
   See the patch.
   Found with the help of smatch + enhanced unfree script.

Bye,
    Oleg

===== fs/nfs/inode.c 1.72 vs edited =====
--- 1.72/fs/nfs/inode.c	Thu Feb 13 15:57:46 2003
+++ edited/fs/nfs/inode.c	Tue Mar 11 18:03:07 2003
@@ -1231,6 +1231,7 @@
 
 	if (root->size > sizeof(root->data)) {
 		printk("nfs_get_sb: invalid root filehandle\n");
+		kfree(server);
 		return ERR_PTR(-EINVAL);
 	}
 	/* We now require that the mount process passes the remote address */

                 reply	other threads:[~2003-03-11 15:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20030311181105.A3232@namesys.com \
    --to=green@namesys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    --cc=trond.myklebust@fys.uio.no \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.