Re: [PATCHES] libpq: fix unlikely memory leak

2005-06-29 Thread Neil Conway
Tom Lane wrote: Since both allocations are only transient within this routine, there's a simpler more effective solution, which is to only do one malloc in the first place Yeah, true. Attached is a revised patch -- committed to HEAD. -Neil Index: src/interfaces/libpq/fe-auth.c

Re: [PATCHES] libpq: fix unlikely memory leak

2005-06-29 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes: > The attached patch fixes a theoretical memory leak in libpq: if the > second malloc() fails due to OOM, the memory returned by the first > (successful) malloc() will be leaked. Since both allocations are only transient within this routine, there's a simp

[PATCHES] libpq: fix unlikely memory leak

2005-06-29 Thread Neil Conway
The attached patch fixes a theoretical memory leak in libpq: if the second malloc() fails due to OOM, the memory returned by the first (successful) malloc() will be leaked. Barring any objections I'll apply this tomorrow. Per report from EnterpriseDB's Coverity analysis. -Neil Index: src/inte