dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: Shahzad Hussain Bangash <ext-shahzad.bangash@nokia.com>
Cc: dm-devel <dm-devel@redhat.com>
Subject: Re: dm: Fixes memory leak in setup_indexes function
Date: Fri, 6 Aug 2010 08:29:21 -0400	[thread overview]
Message-ID: <20100806122921.GB32629@redhat.com> (raw)
In-Reply-To: <1281087367.2262.44.camel@sbangash-desktop>

On Fri, Aug 06 2010 at  5:36am -0400,
Shahzad Hussain Bangash <ext-shahzad.bangash@nokia.com> wrote:

> Sorry for multiple patches. This patch fixes memory leak in
> setup_indexes function where memory is allocated for indexes pointer by
> dm_vcalloc with the size of NODE_size and is not freed after that
> through the end of the function.

There isn't a leak.

The 2nd loop's "t->index[i] = indexes;" takes ownership of the
dm_vcalloc'd memory.  dm_table_destroy() will later free that memory.

Your patch actually introduces a use after free bug.

Regards,
Mike

      reply	other threads:[~2010-08-06 12:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-06  9:36 [PATCH] dm: Fixes memory leak in setup_indexes function Shahzad Hussain Bangash
2010-08-06 12:29 ` Mike Snitzer [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=20100806122921.GB32629@redhat.com \
    --to=snitzer@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=ext-shahzad.bangash@nokia.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).