linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Tinguely <tinguely@sgi.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: Eric Sandeen <sandeen@redhat.com>, xfs@oss.sgi.com
Subject: Re: [PATCH 15/14] xfs_io: free memory on error path exit from bmap_f()
Date: Thu, 10 Apr 2014 08:38:56 -0500	[thread overview]
Message-ID: <53469EF0.3030407@sgi.com> (raw)
In-Reply-To: <5345C751.8040803@sandeen.net>

On 04/09/14 17:18, Eric Sandeen wrote:
> If realloc() fails, the memory it was trying to realloc remains;
> free it on the error path.
>
> Signed-off-by: Eric Sandeen<sandeen@redhat.com>
> ---
>
> diff --git a/io/bmap.c b/io/bmap.c
> index a78cbb1..8e5d75e 100644
> --- a/io/bmap.c
> +++ b/io/bmap.c
> @@ -227,6 +227,7 @@ bmap_f(
>   				fprintf(stderr,
>   					_("%s: cannot realloc %d bytes\n"),
>   					progname, (int)(map_size*sizeof(*map)));
> +				free(map);
>   				exitcode = 1;
>   				return 0;
>   			}


Didn't it get into this block by comparing map to NULL?

--Mark.

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

  reply	other threads:[~2014-04-10 13:38 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-08 23:24 [PATCH 00/14] xfsprogs: varius & sundry fixes for coverity defects Eric Sandeen
2014-04-08 23:24 ` [PATCH 01/14] xfsprogs: fix various fd leaks Eric Sandeen
2014-04-08 23:24 ` [PATCH 02/14] xfsprogs: refactor fsrall_cleanup in xfs_fsr Eric Sandeen
2014-04-08 23:24 ` [PATCH 03/14] xfsprogs: trivial buffer frees on error paths Eric Sandeen
2014-04-11 19:03   ` Brian Foster
2014-04-11 22:25   ` [PATCH 03/14 V2] " Eric Sandeen
2014-04-08 23:24 ` [PATCH 04/14] xfsprogs: fix memory leak in xlog_recover_add_to_trans Eric Sandeen
2014-04-08 23:24 ` [PATCH 05/14] libxfs: fix memory leak in xfs_dir2_node_removename Eric Sandeen
2014-04-08 23:24 ` [PATCH 06/14] xfs_quota: fix memory leak in quota_group_type() error path Eric Sandeen
2014-04-08 23:24 ` [PATCH 07/14] xfs_logprint: fix leak in error path of xlog_print_record() Eric Sandeen
2014-04-08 23:24 ` [PATCH 08/14] xfsprogs: free resources in libxfs_alloc_file_space error paths Eric Sandeen
2014-04-11 19:03   ` Brian Foster
2014-04-11 22:49   ` [PATCH 08/14 V2] " Eric Sandeen
2014-04-08 23:24 ` [PATCH 09/14] xfsprogs: annotate a case fallthrough in libxfs_ialloc Eric Sandeen
2014-04-08 23:25 ` [PATCH 10/14] xfsprogs: fix too-large memset value in xfs_db's attr code Eric Sandeen
2014-04-08 23:25 ` [PATCH 11/14] xfs_quota: remove impossible tests in printpath Eric Sandeen
2014-04-08 23:25 ` [PATCH 12/14] xfs_repair: address never-true tests in repair/bmap.c on 64 bit Eric Sandeen
2014-04-09 13:55   ` Mark Tinguely
2014-04-09 14:36   ` [PATCH 12/14 V2] " Eric Sandeen
2014-04-08 23:25 ` [PATCH 13/14] mkfs: catch unknown format in protofile parsing Eric Sandeen
2014-04-08 23:25 ` [PATCH 14/14] xfs_db: don't use invalid index in ring_f Eric Sandeen
2014-04-09 22:18 ` [PATCH 15/14] xfs_io: free memory on error path exit from bmap_f() Eric Sandeen
2014-04-10 13:38   ` Mark Tinguely [this message]
2014-04-10 14:15     ` Eric Sandeen
2014-04-11 19:02 ` [PATCH 00/14] xfsprogs: varius & sundry fixes for coverity defects Brian Foster

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=53469EF0.3030407@sgi.com \
    --to=tinguely@sgi.com \
    --cc=sandeen@redhat.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 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).