From 8f1c8e13fc8db6e7879a8372e33b8720d4de7b9e Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Tue, 16 Sep 2014 09:19:08 +1000 Subject: [PATCH] libhandle: Fix handle leak in path_to_fshandle error paths 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 Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- libhandle/handle.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libhandle/handle.c b/libhandle/handle.c index 9f81483b5..3c1395a64 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; -- 2.50.1