Re: dm: Fixes memory leak in setup_indexes function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 06 2010 at  5:36am -0400,
Shahzad Hussain Bangash <ext-shahzad.bangash@xxxxxxxxx> 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

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel


[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux