linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.cz>
Subject: [PATCH 5/5] btrfs-progs: fix minor leak of dev_info in btrfs_scan_kernel
Date: Tue, 30 Dec 2014 15:57:50 +0100	[thread overview]
Message-ID: <f8a24717b11fa5501ade5c76077584f771b005c1.1419951036.git.dsterba@suse.cz> (raw)
In-Reply-To: <cover.1419951036.git.dsterba@suse.cz>

Resolves-coverity-id: 1127098
Signed-off-by: David Sterba <dsterba@suse.cz>
---
 cmds-filesystem.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index 1c1d34ae8ca2..a3cf114fb6ac 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -516,8 +516,10 @@ static int btrfs_scan_kernel(void *search)
 			continue;
 		ret = get_fs_info(mnt->mnt_dir, &fs_info_arg,
 				&dev_info_arg);
-		if (ret)
+		if (ret) {
+			kfree(dev_info_arg);
 			goto out;
+		}
 
 		if (get_label_mounted(mnt->mnt_dir, label)) {
 			kfree(dev_info_arg);
-- 
2.1.3


      parent reply	other threads:[~2014-12-30 14:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-30 14:57 [PATCH 0/5] Btrfs progs, coverity fixes for 3.18-rc3 David Sterba
2014-12-30 14:57 ` [PATCH 1/5] btrfs-progs: check, fix path leak in error branch David Sterba
2014-12-30 14:57 ` [PATCH 2/5] btrfs-progs: fi show, don't leak canonical path David Sterba
2014-12-30 14:57 ` [PATCH 3/5] btrfs-progs: check, missing parens around compound block in find_normal_file_extent David Sterba
2014-12-30 14:57 ` [PATCH 4/5] btrfs-progs: fix overflow check in btrfs_insert_inode_ref David Sterba
2014-12-30 14:57 ` David Sterba [this message]

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=f8a24717b11fa5501ade5c76077584f771b005c1.1419951036.git.dsterba@suse.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    /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).