Re: Error in recent pg_dump change (coverity) - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Error in recent pg_dump change (coverity)
Date
Msg-id 20060528161334.GC22869@svana.org
Whole thread Raw
In response to Re: Error in recent pg_dump change (coverity)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Error in recent pg_dump change (coverity)
List pgsql-hackers
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.

pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Error in recent pg_dump change (coverity)
Next
From: Tom Lane
Date:
Subject: Re: Error in recent pg_dump change (coverity)