pgsql: Fix file descriptor leak after failure of a \setshell command in - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix file descriptor leak after failure of a \setshell command in
Date
Msg-id E1Y0wvZ-0006cB-Oj@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix file descriptor leak after failure of a \setshell command in pgbench.

If the called command fails to return data, runShellCommand forgot to
pclose() the pipe before returning.  This is fairly harmless in the current
code, because pgbench would then abandon further processing of that client
thread; so no more than nclients descriptors could be leaked this way.  But
it's not hard to imagine future improvements whereby that wouldn't be true.
In any case, it's sloppy coding, so patch all branches.  Found by Coverity.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/d38e8d30cecea96a088330133e232c465a222d0a

Modified Files
--------------
contrib/pgbench/pgbench.c |    1 +
1 file changed, 1 insertion(+)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix file descriptor leak after failure of a \setshell command in
Next
From: Tom Lane
Date:
Subject: pgsql: Fix file descriptor leak after failure of a \setshell command in