On Sun, May 28, 2006 at 12:00:33PM -0400, Tom Lane wrote:
> Another possibility is to just MemSet the whole PGresult struct
> to zeroes before free'ing it.  Compared to the cost of obtaining
> a query result from the backend, this probably doesn't cost enough
> to be worth worrying about, and it would catch a few more problems
> of the same ilk.

Probably better actually, since by setting ntups to zero also,
PQgetvalue will return a warning (row number out of range) rather than
segfaulting...

Have a nice day,
-- 
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to 
> litigate.

Attachment: signature.asc
Description: Digital signature

Reply via email to