This is an automated email from the ASF dual-hosted git repository.

reshke pushed a commit to branch reshke-patch-2
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit 62330090bac36cdce6064bb445a957e3828f03ca
Author: reshke <[email protected]>
AuthorDate: Sat Jan 17 02:34:39 2026 +0500

    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)
        {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to