Re: [HACKERS] Assorted leaks of PGresults

2017-06-14 Thread Michael Paquier
On Thu, Jun 15, 2017 at 9:36 AM, Tom Lane wrote: > Coverity complained that libpqwalreceiver.c's libpqrcv_PQexec() > potentially leaks a PGresult. It's right: if PQconsumeInput() fails after > we've already collected at least one PGresult, the function just returns > NULL without remembering to f

[HACKERS] Assorted leaks of PGresults

2017-06-14 Thread Tom Lane
Coverity complained that libpqwalreceiver.c's libpqrcv_PQexec() potentially leaks a PGresult. It's right: if PQconsumeInput() fails after we've already collected at least one PGresult, the function just returns NULL without remembering to free last_result. That's easy enough to fix, just insert "