linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: btrfs_list_find_updated_files: Fix memory leak.
@ 2013-10-07  6:36 chandan
  0 siblings, 0 replies; only message in thread
From: chandan @ 2013-10-07  6:36 UTC (permalink / raw)
  To: linux-btrfs; +Cc: sekharan, dsterba

The current code returns from the function when the call to ioctl
fails. This may leak cache_dir_name and cache_full_name. Fix it.

Signed-off-by: chandan <chandan@linux.vnet.ibm.com>
---
 btrfs-list.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/btrfs-list.c b/btrfs-list.c
index 9cadbf5..9411e4d 100644
--- a/btrfs-list.c
+++ b/btrfs-list.c
@@ -1686,7 +1686,7 @@ int btrfs_list_find_updated_files(int fd, u64 root_id, u64 oldest_gen)
 		if (ret < 0) {
 			fprintf(stderr, "ERROR: can't perform the search- %s\n",
 				strerror(e));
-			return ret;
+			break;
 		}
 		/* the ioctl returns the number of item it found in nr_items */
 		if (sk->nr_items == 0)
-- 
1.8.3.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-10-07  6:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-07  6:36 [PATCH] btrfs-progs: btrfs_list_find_updated_files: Fix memory leak chandan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).