Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5b2c8f0

Browse files
committed
Fix file descriptor leak after failure of a \setshell command in pgbench.
If the called command fails to return data, runShellCommand forgot topclose() the pipe before returning. This is fairly harmless in the currentcode, because pgbench would then abandon further processing of that clientthread; so no more than nclients descriptors could be leaked this way. Butit'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.
1 parentcd63c57 commit5b2c8f0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

‎contrib/pgbench/pgbench.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,7 @@ runShellCommand(CState *st, char *variable, char **argv, int argc)
749749
{
750750
if (!timer_exceeded)
751751
fprintf(stderr,"%s: cannot read the result\n",argv[0]);
752+
(void)pclose(fp);
752753
return false;
753754
}
754755
if (pclose(fp)<0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp