From: chandan <chandan@linux.vnet.ibm.com>
To: linux-btrfs@vger.kernel.org
Cc: sekharan@us.ibm.com, dsterba@suse.cz
Subject: [PATCH] btrfs-progs: btrfs_list_find_updated_files: Fix memory leak.
Date: Mon, 07 Oct 2013 12:06:11 +0530 [thread overview]
Message-ID: <10157896.KS57RD9T2T@localhost.localdomain> (raw)
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
reply other threads:[~2013-10-07 6:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=10157896.KS57RD9T2T@localhost.localdomain \
--to=chandan@linux.vnet.ibm.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=sekharan@us.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).