• Tom Lane's avatar
    Fix file descriptor leak after failure of a \setshell command in pgbench. · d38e8d30
    Tom Lane authored
    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.
    d38e8d30
pgbench.c 97.8 KB