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 1/5] btrfs-progs: check, fix path leak in error branch
Date: Tue, 30 Dec 2014 15:57:37 +0100	[thread overview]
Message-ID: <0665aaf5a3733c5153e7fc0959d813c6ff76ee34.1419951036.git.dsterba@suse.cz> (raw)
In-Reply-To: <cover.1419951036.git.dsterba@suse.cz>

Resolves-coverity-id: 1260250
Signed-off-by: David Sterba <dsterba@suse.cz>
---
 cmds-check.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/cmds-check.c b/cmds-check.c
index e74b116c0c43..71e4f4f3a13b 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -2839,7 +2839,7 @@ static int repair_btree(struct btrfs_root *root,
 		ret = PTR_ERR(trans);
 		fprintf(stderr, "Error starting transaction: %s\n",
 			strerror(-ret));
-		return ret;
+		goto out_free_path;
 	}
 	cache = first_cache_extent(corrupt_blocks);
 	while (cache) {
@@ -2894,8 +2894,9 @@ static int repair_btree(struct btrfs_root *root,
 		cache = next_cache_extent(cache);
 	}
 out:
-	btrfs_free_path(path);
 	btrfs_commit_transaction(trans, root);
+out_free_path:
+	btrfs_free_path(path);
 	return ret;
 }
 
-- 
2.1.3


  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 ` David Sterba [this message]
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 ` [PATCH 5/5] btrfs-progs: fix minor leak of dev_info in btrfs_scan_kernel David Sterba

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=0665aaf5a3733c5153e7fc0959d813c6ff76ee34.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).