linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: xfs-oss <xfs@oss.sgi.com>, Mark Tinguely <tinguely@sgi.com>
Subject: [PATCH 1/2] xfs_logprint: Fix error handling in xlog_print_trans_efi
Date: Mon, 14 Apr 2014 09:46:37 -0500	[thread overview]
Message-ID: <534BF4CD.1080702@sandeen.net> (raw)
In-Reply-To: <534BF472.8030908@sandeen.net>

A recent change to xlog_print_trans_efi() led to a leaked
"src_f" on this error return.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/logprint/log_misc.c b/logprint/log_misc.c
index 928f60a..d482cf3 100644
--- a/logprint/log_misc.c
+++ b/logprint/log_misc.c
@@ -482,7 +482,7 @@ xlog_print_trans_efi(
 	uint src_len,
 	int continued)
 {
-    xfs_efi_log_format_t *src_f, *f;
+    xfs_efi_log_format_t *src_f, *f = NULL;
     uint		 dst_len;
     xfs_extent_t	 *ex;
     int			 i;
@@ -505,7 +505,8 @@ xlog_print_trans_efi(
 
     if (continued && src_len < core_size) {
 	printf(_("EFI: Not enough data to decode further\n"));
-	return 1;
+	error = 1;
+	goto error;
     }
 
     if ((f = (xfs_efi_log_format_t *)malloc(dst_len)) == NULL) {

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2014-04-14 14:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-14 14:45 [PATCH 0/2] xfsprogs: 2 quick coverity fixes Eric Sandeen
2014-04-14 14:46 ` Eric Sandeen [this message]
2014-04-14 14:54   ` [PATCH 1/2] xfs_logprint: Fix error handling in xlog_print_trans_efi Mark Tinguely
2014-04-14 14:48 ` [PATCH 2/2] mkfs.xfs: prevent close(-1) on protofile error path Eric Sandeen
2014-04-14 15:01   ` Mark Tinguely

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=534BF4CD.1080702@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=tinguely@sgi.com \
    --cc=xfs@oss.sgi.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).