Bug#586621: Regarding the proposed patch

Colin Watson cjwatson at debian.org
Mon Jul 5 00:12:19 UTC 2010


tags 586621 fixed-upstream
thanks

On Sun, Jul 04, 2010 at 05:26:12PM +0300, M. Vefa Bicakci wrote:
> I noticed that you didn't move the "free(new_prefix)" line
> to the end of the function. The net effect of not doing this
> is that you might use the "new_prefix" pointer later even
> though you "free()"d it before.

Thanks to both of you.  I've committed a patch upstream based on these
suggestions; I named variables slightly differently, though, renaming
prefix to install_prefix in line with install_dos_part and
install_bsd_part.

> Attached is the patch which includes a fix for this problem.
> It frees the new_prefix pointer at the end of the function
> only if it is non-NULL.

Note that free (NULL) is defined to be a no-op, so it's safe to omit the
condition here.  I did so in the patch I committed.

Regards,

-- 
Colin Watson                                       [cjwatson at debian.org]





More information about the Pkg-grub-devel mailing list