[PATCH 4/6] libhandle: Fix handle leak in path_to_fshandle error paths
Eric Sandeen
sandeen at redhat.com
Fri Aug 1 09:59:17 CDT 2014
path_to_fshandle calls obj_to_handle, which potentially
allocates a handle, but the handle isn't freed on
a subsequent error path.
Signed-off-by: Eric Sandeen <sandeen at redhat.com>
---
libhandle/handle.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/libhandle/handle.c b/libhandle/handle.c
index 9f81483..3c1395a 100644
--- a/libhandle/handle.c
+++ b/libhandle/handle.c
@@ -97,6 +97,7 @@ path_to_fshandle(
/* new filesystem. add it to the cache */
fdhp = malloc(sizeof(struct fdhash));
if (fdhp == NULL) {
+ free(*fshanp);
close(fd);
errno = ENOMEM;
return -1;
--
1.7.1
More information about the xfs
mailing list