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