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

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


The following commit(s) were added to refs/heads/main by this push:
     new d5b806c346d Do not initialize programm query string when unneeded. 
(#1536)
d5b806c346d is described below

commit d5b806c346d66ad8684ee8e89eb8459d9c7ecfb6
Author: reshke <[email protected]>
AuthorDate: Thu Jan 22 10:53:55 2026 +0500

    Do not initialize programm query string when unneeded. (#1536)
    
    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