btrfs-progs: btrfs_list_find_updated_files: Fix memory leak.
authorchandan <chandan@linux.vnet.ibm.com>
Mon, 7 Oct 2013 06:36:11 +0000 (12:06 +0530)
committerChris Mason <chris.mason@fusionio.com>
Wed, 16 Oct 2013 12:23:12 +0000 (08:23 -0400)
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>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
btrfs-list.c

index 9cadbf5..9411e4d 100644 (file)
@@ -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)