Skip to contentSkip to conversation

btrfs-progs: btrfs_list_find_updated_files: Fix memory leak.

PATCH New chandan 1 participant 1 message Oct 7, 2013 Btrfs file system

lore
Share & tools
lore

chandan

author
#0 lore raw

PATCH 1/1 btrfs-progs: btrfs_list_find_updated_files: Fix memory leak.

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.

---
 btrfs-list.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
btrfs-list.c +1 -1
index 9cadbf5..9411e4d 100644
@@ -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)
Signature · 1 line
1.8.3.1