Re: [HACKERS] Small memory leak in execute.c of ECPG driver

2015-02-04 Thread Heikki Linnakangas
On 02/03/2015 02:45 PM, Michael Paquier wrote: On Tue, Feb 3, 2015 at 5:35 PM, Heikki Linnakangas hlinnakan...@vmware.com wrote: I think there are more similar leaks nearby. After the first hunk, there's another if-check with return false that also leaks mallocedval. Right after the two other

Re: [HACKERS] Small memory leak in execute.c of ECPG driver

2015-02-03 Thread Heikki Linnakangas
On 02/03/2015 08:58 AM, Michael Paquier wrote: Hi all, In exactly 3 places of the ECPG driver (for numeric, for interval and for date), we do something as follows: /* Allocation of mallocedval */ if (!(mallocedval = ecpg_strdup(array [, lineno))) return false; for (element = 0;

Re: [HACKERS] Small memory leak in execute.c of ECPG driver

2015-02-03 Thread Michael Paquier
On Tue, Feb 3, 2015 at 5:35 PM, Heikki Linnakangas hlinnakan...@vmware.com wrote: I think there are more similar leaks nearby. After the first hunk, there's another if-check with return false that also leaks mallocedval. Right after the two other hunks, if the ecpg_realloc fails, we again leak

[HACKERS] Small memory leak in execute.c of ECPG driver

2015-02-02 Thread Michael Paquier
Hi all, In exactly 3 places of the ECPG driver (for numeric, for interval and for date), we do something as follows: /* Allocation of mallocedval */ if (!(mallocedval = ecpg_strdup(array [, lineno))) return false; for (element = 0; element var-arrsize; element++) { int