Re: [HACKERS] Collection of memory leaks for ECPG driver

2015-06-15 Thread Michael Paquier
On Mon, Jun 15, 2015 at 9:33 PM, Michael Meskes wrote: > On Sun, Jun 14, 2015 at 08:43:13PM +0900, Michael Paquier wrote: >> point out that there is still a leak in connect.c. Per se the attached >> patch, that does not check for a NULL pointer before ecpg_free because >> other code paths in the r

Re: [HACKERS] Collection of memory leaks for ECPG driver

2015-06-15 Thread Michael Meskes
On Sun, Jun 14, 2015 at 08:43:13PM +0900, Michael Paquier wrote: > point out that there is still a leak in connect.c. Per se the attached > patch, that does not check for a NULL pointer before ecpg_free because > other code paths in the routine patched don't do so. So you get > something locally co

Re: [HACKERS] Collection of memory leaks for ECPG driver

2015-06-14 Thread Michael Paquier
On Sat, Jun 13, 2015 at 6:25 PM, Michael Meskes wrote: > On Sat, Jun 13, 2015 at 12:02:40AM -0400, Tom Lane wrote: >> But having said that, I would not be in a hurry to remove any existing >> if-guards for the case. For one thing, it makes the code look more >> similar to backend code that uses p

Re: [HACKERS] Collection of memory leaks for ECPG driver

2015-06-13 Thread Michael Meskes
On Sat, Jun 13, 2015 at 12:02:40AM -0400, Tom Lane wrote: > But having said that, I would not be in a hurry to remove any existing > if-guards for the case. For one thing, it makes the code look more > similar to backend code that uses palloc/pfree, where we do *not* allow > pfree(NULL). There's

Re: [HACKERS] Collection of memory leaks for ECPG driver

2015-06-12 Thread Tom Lane
Michael Paquier writes: > On Fri, Jun 12, 2015 at 10:01 PM, Michael Meskes > wrote: >> More seriously, though, does anyone know of any platform where free(NULL) is >> *not* a noop? > I recall reading that some past versions of SunOS crashed, but it is > rather old... Yeah, SunOS 4.x had issue

Re: [HACKERS] Collection of memory leaks for ECPG driver

2015-06-12 Thread Michael Paquier
On Fri, Jun 12, 2015 at 10:01 PM, Michael Meskes wrote: > On Mon, Jun 08, 2015 at 10:50:25PM +0900, Michael Paquier wrote: > Right, that's because they were developed before free received the safeguard, > or the programmer simply didn't know at that point in time. Unless I'm > mistaken we have o

Re: [HACKERS] Collection of memory leaks for ECPG driver

2015-06-12 Thread Michael Meskes
On Mon, Jun 08, 2015 at 10:50:25PM +0900, Michael Paquier wrote: > And the caller needs to be sure that str actually allocates enough > space.. That's not directly ECPG's business, still it feels But there is no way for us to fix this as we want to implement the API as defined in Informix. > unco

Re: [HACKERS] Collection of memory leaks for ECPG driver

2015-06-08 Thread Michael Paquier
On Mon, Jun 8, 2015 at 9:22 PM, Michael Meskes wrote: > On Mon, Jun 08, 2015 at 01:57:32PM +0900, Michael Paquier wrote: >> diff --git a/src/interfaces/ecpg/compatlib/informix.c >> b/src/interfaces/ecpg/compatlib/informix.c >> index d6de3ea..c1e3dfb 100644 >> --- a/src/interfaces/ecpg/compatlib/in

Re: [HACKERS] Collection of memory leaks for ECPG driver

2015-06-08 Thread Michael Meskes
On Mon, Jun 08, 2015 at 01:57:32PM +0900, Michael Paquier wrote: > Please find attached a patch aimed at fixing a couple of memory leaks > in the ECPG driver. Coverity (and sometimes I after reading some other > code paths) found them. And some are not correct it seems. But then some of the code i

[HACKERS] Collection of memory leaks for ECPG driver

2015-06-07 Thread Michael Paquier
Hi all, Please find attached a patch aimed at fixing a couple of memory leaks in the ECPG driver. Coverity (and sometimes I after reading some other code paths) found them. Regards, -- Michael diff --git a/src/interfaces/ecpg/compatlib/informix.c b/src/interfaces/ecpg/compatlib/informix.c index d