From: chandan Date: Mon, 7 Oct 2013 06:36:11 +0000 (+0530) Subject: btrfs-progs: btrfs_list_find_updated_files: Fix memory leak. X-Git-Tag: upstream/4.16.1~3091 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6659f446d4b57018ba7b04a7b9c7cdd553ad9f7a;p=platform%2Fupstream%2Fbtrfs-progs.git 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. Signed-off-by: chandan Signed-off-by: David Sterba Signed-off-by: Chris Mason --- 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)