* [PATCH] xfsprogs: fix open_by_handle memory leak
@ 2011-05-06 16:42 Bill Kendall
2011-05-09 14:06 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Bill Kendall @ 2011-05-06 16:42 UTC (permalink / raw)
To: xfs
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] xfsprogs: fix open_by_handle memory leak
2011-05-06 16:42 [PATCH] xfsprogs: fix open_by_handle memory leak Bill Kendall
@ 2011-05-09 14:06 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2011-05-09 14:06 UTC (permalink / raw)
To: Bill Kendall; +Cc: xfs
On Fri, May 06, 2011 at 11:42:57AM -0500, Bill Kendall wrote:
> 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>
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-05-09 14:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-06 16:42 [PATCH] xfsprogs: fix open_by_handle memory leak Bill Kendall
2011-05-09 14:06 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox