bug-parted
[Top][All Lists]
Advanced

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

Re: memory leak in gpt.c (Fixed the correct way)


From: Patrick Leslie Polzer
Subject: Re: memory leak in gpt.c (Fixed the correct way)
Date: Mon, 26 Dec 2005 17:56:23 +0100

On Mon, 26 Dec 2005 10:34:28 -0600
Harley D. Eades III <"Harley D. Eades III" <address@hidden>> wrote:

 | What is the difference between what I have and a PED_ASSERT? All the
 | PED_ASSERT will do is return if pth is NULL, right?  The function as is
 | will not free anything unless there is memory, which is in my mind
 | correct.
The problem is the crash that will occur when you dereference the pointer in

  if (pth->Reserved2)

If pth is NULL, for which you check afterwards (never reached in this case!),
the program will crash.

As for the assertion, it will throw a fatal exception if it is not fullfilled
instead of just returning.

HTH,

~ Leslie

-- 
PGP-KID: 0x52D70289

Attachment: pgpY9BOapXAhR.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]