[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: memory leak in gpt.c (Fixed the correct way)
From: |
Harley D. Eades III |
Subject: |
Re: memory leak in gpt.c (Fixed the correct way) |
Date: |
Mon, 26 Dec 2005 11:04:13 -0600 |
On Mon, 2005-12-26 at 17:19 +0100, Håkon Løvdal wrote:
> On 12/26/05, Harley D. Eades III <address@hidden> 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.
Fixed, thanks
Cheers
-- Harley
-----BEGIN GEEK CODE BLOCK-----
G: GCS-- d- a? C++++ B- E+++ W+++ N++ w--- X+++ b++ G e* r x+ z+++++
------END GEEK CODE BLOCK------
- Re: memory leak in gpt.c (Fixed the correct way), (continued)
- Re: memory leak in gpt.c (Fixed the correct way), Patrick Leslie Polzer, 2005/12/23
- Re: memory leak in gpt.c (Fixed the correct way), Harley D. Eades III, 2005/12/23
- Re: memory leak in gpt.c (Fixed the correct way), Harley D. Eades III, 2005/12/26
- Re: memory leak in gpt.c (Fixed the correct way), Patrick Leslie Polzer, 2005/12/26
- Re: memory leak in gpt.c (Fixed the correct way), Håkon Løvdal, 2005/12/26
- Re: memory leak in gpt.c (Fixed the correct way), Patrick Leslie Polzer, 2005/12/26
- Re: memory leak in gpt.c (Fixed the correct way), Harley D. Eades III, 2005/12/26
- Re: memory leak in gpt.c (Fixed the correct way), Patrick Leslie Polzer, 2005/12/26
- Re: memory leak in gpt.c (Fixed the correct way), Harley D. Eades III, 2005/12/26
- Re: memory leak in gpt.c (Fixed the correct way), Otavio Salvador, 2005/12/26
- Re: memory leak in gpt.c (Fixed the correct way),
Harley D. Eades III <=