public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Bill Kendall <wkendall@sgi.com>
To: xfs@oss.sgi.com
Subject: [PATCH] xfsprogs: fix open_by_handle memory leak
Date: Fri,  6 May 2011 11:42:57 -0500	[thread overview]
Message-ID: <1304700177-8505-1-git-send-email-wkendall@sgi.com> (raw)

open_by_handle() calls handle_to_fshandle() which
allocates an fshandle on the heap, which is never
freed by open_by_handle(). There is no need to
call handle_to_fshandle() though, just pass the
fhandle (rather than fshandle) to handle_to_fsfd(),
like the other *_by_handle() functions do.

Signed-off-by: Bill Kendall <wkendall@sgi.com>
---
 libhandle/handle.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/libhandle/handle.c b/libhandle/handle.c
index c3a6129..b1ec5f2 100644
--- a/libhandle/handle.c
+++ b/libhandle/handle.c
@@ -292,14 +292,9 @@ open_by_handle(
 {
 	int		fsfd;
 	char		*path;
-	void		*fshanp;
-	size_t		fshlen;
 	xfs_fsop_handlereq_t hreq;
 
-	if (handle_to_fshandle(hanp, hlen, &fshanp, &fshlen) != 0)
-		return -1;
-
-	if ((fsfd = handle_to_fsfd(fshanp, &path)) < 0)
+	if ((fsfd = handle_to_fsfd(hanp, &path)) < 0)
 		return -1;
 
 	hreq.fd       = 0;
-- 
1.7.0.4

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

             reply	other threads:[~2011-05-06 16:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-06 16:42 Bill Kendall [this message]
2011-05-09 14:06 ` [PATCH] xfsprogs: fix open_by_handle memory leak Christoph Hellwig

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=1304700177-8505-1-git-send-email-wkendall@sgi.com \
    --to=wkendall@sgi.com \
    --cc=xfs@oss.sgi.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