Repository: incubator-hawq
Updated Branches:
  refs/heads/HAWQ-400 73eb65f61 -> 1b362bbf6


HAWQ-400. Support expected exit codes for regression tests, fixed leaks.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/1b362bbf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/1b362bbf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/1b362bbf

Branch: refs/heads/HAWQ-400
Commit: 1b362bbf68cb9bfe23d4dc06e40f18a4c9abf582
Parents: 73eb65f
Author: Oleksandr Diachenko <odiache...@pivotal.io>
Authored: Thu Feb 18 15:03:20 2016 -0800
Committer: Oleksandr Diachenko <odiache...@pivotal.io>
Committed: Thu Feb 18 15:03:20 2016 -0800

----------------------------------------------------------------------
 src/test/regress/pg_regress.c | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1b362bbf/src/test/regress/pg_regress.c
----------------------------------------------------------------------
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index b1f1846..9f4c244 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -780,6 +780,8 @@ doputenv(const char *var, const char *val)
 
        sprintf(s, "%s=%s", var, val);
        putenv(s);
+
+       free(s);
 }
 
 /*
@@ -844,6 +846,8 @@ initialize_environment(void)
                new_pgoptions = malloc(strlen(old_pgoptions) + 
strlen(my_pgoptions) + 12);
                sprintf(new_pgoptions, "PGOPTIONS=%s %s", old_pgoptions, 
my_pgoptions);
                putenv(new_pgoptions);
+
+               free(new_pgoptions);
        }
 
        {
@@ -982,6 +986,7 @@ spawn_process(const char *cmdline)
                execl(shellprog, shellprog, "-c", cmdline2, (char *) NULL);
                fprintf(stderr, _("%s: could not exec \"%s\": %s\n"),
                                progname, shellprog, strerror(errno));
+               free(cmdline2);
                exit(1);                                /* not exit_nicely 
here... */
        }
        /* in parent */
@@ -1057,6 +1062,7 @@ spawn_process(const char *cmdline)
 
        cmdline2 = malloc(strlen(cmdline) + 8);
        sprintf(cmdline2, "cmd /c %s", cmdline);
+       free(cmdline2);
 
 #ifndef __CYGWIN__
        AddUserToTokenDacl(restrictedToken);

Reply via email to