dm: Fixes memory leak in setup_indexes function
On Fri, Aug 06 2010 at 5:36am -0400,
Shahzad Hussain Bangash <firstname.lastname@example.org> 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.
dm-devel mailing list