Re: [HACKERS] 6.1 progress - Mailing list pgsql-hackers

From Igor
Subject Re: [HACKERS] 6.1 progress
Date
Msg-id 364955d44a69da4d71204978df54945d
Whole thread Raw
In response to [HACKERS] 6.1 progress  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
Actually, there was a free statement ..... in the wrong place...It was
useless there. But this problem is exactly what I am talking about ...
reading these lines....

I have tested pretty much everything in psql so far after fixing this bug,
and there hasn't been either a memory leak or some memory violation...
I'll probably run regression tests tomorrow, then post the patch...

There was also another small bug where the line was
1. Under one condition it was simply set to point to something that
   was staticly allocated, so freeing is not allowed.
2. If above condition fails, it will be malloc'ed... Of course
   there was no free there, and it leaked the whole 10 bytes...:(


>     line = malloc();
>     fgets(line);
>
>     But never did a free(line); after we were finished with the
> data in line, just assigning a new memory segment to it...
>
> Marc G. Fournier
> Systems Administrator @ hub.org
> primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org
>

------------------------------

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] 6.1 progress
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] 6.1 progress