From ebe9e51c64f96e81355f3cd4e786ba5274a2d1e3 Mon Sep 17 00:00:00 2001 From: reshke Date: Sat, 17 Jan 2026 02:34:39 +0500 Subject: [PATCH] Do not initialize programm query string when unneeded. Also, while on it, beautify code to conform PG-style coding. Per coverity report 544476 --- src/backend/commands/copy.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index efbf6a0ba39..4ccd3798067 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -1420,20 +1420,17 @@ close_program_pipes(ProgramPipes *program_pipes, bool ifThrow) { int ret = 0; StringInfoData sinfo; - initStringInfo(&sinfo); /* just return if pipes not created, like when relation does not exist */ if (!program_pipes) - { return; - } + + initStringInfo(&sinfo); ret = pclose_with_stderr(program_pipes->pid, program_pipes->pipes, &sinfo); if (ret == 0 || !ifThrow) - { return; - } if (ret == -1) {