All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Tinguely <tinguely@sgi.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH 1/2] xfs_logprint: Fix error handling in xlog_print_trans_efi
Date: Mon, 14 Apr 2014 09:54:24 -0500	[thread overview]
Message-ID: <534BF6A0.2070202@sgi.com> (raw)
In-Reply-To: <534BF4CD.1080702@sandeen.net>

On 04/14/14 09:46, Eric Sandeen wrote:
> 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) {
>

Looks good. Thank-you Eric and Coverity.

Reviewed-by: Mark Tinguely <tinguely@sgi.com>

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

  reply	other threads:[~2014-04-14 14:54 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 ` [PATCH 1/2] xfs_logprint: Fix error handling in xlog_print_trans_efi Eric Sandeen
2014-04-14 14:54   ` Mark Tinguely [this message]
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=534BF6A0.2070202@sgi.com \
    --to=tinguely@sgi.com \
    --cc=sandeen@sandeen.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.