Skip to content

Commit e766944

Browse files
reshkehanwei
authored andcommitted
Do not initialize programm query string when unneeded. (#1536)
Also, while on it, beautify code to conform PG-style coding. Per coverity report 544476
1 parent 74936d7 commit e766944

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/backend/commands/copy.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,20 +1420,17 @@ close_program_pipes(ProgramPipes *program_pipes, bool ifThrow)
14201420
{
14211421
int ret = 0;
14221422
StringInfoData sinfo;
1423-
initStringInfo(&sinfo);
14241423

14251424
/* just return if pipes not created, like when relation does not exist */
14261425
if (!program_pipes)
1427-
{
14281426
return;
1429-
}
1427+
1428+
initStringInfo(&sinfo);
14301429

14311430
ret = pclose_with_stderr(program_pipes->pid, program_pipes->pipes, &sinfo);
14321431

14331432
if (ret == 0 || !ifThrow)
1434-
{
14351433
return;
1436-
}
14371434

14381435
if (ret == -1)
14391436
{

0 commit comments

Comments
 (0)