On 12/26/05, Harley D. Eades III <[EMAIL PROTECTED]> wrote:
> +static void
> +pth_free (GuidPartitionTableHeader_t* pth) {
> +       if (pth->Reserved2)
> +               ped_free (pth->Reserved2);
> +
> +       if (pth)
> +               ped_free (pth);
> +}

There is no point in the last "if (pth)" test; if pth is NULL the
program will crash
at the pth->Reserved2 reference. On the question of whether passing NULL
to a function like this should be valid or not I tend to think it
should not, and therefore
suggest adding PED_ASSERT(pth != NULL, return) at the beginning.

BR Håkon Løvdal


_______________________________________________
Bug-parted mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-parted

Reply via email to