]> granicus.if.org Git - postgresql/commitdiff
During parallel pg_dump, free commands from master
authorStephen Frost <sfrost@snowman.net>
Sun, 14 Jul 2013 18:35:26 +0000 (14:35 -0400)
committerStephen Frost <sfrost@snowman.net>
Sun, 14 Jul 2013 18:36:26 +0000 (14:36 -0400)
The command strings read by the child processes during parallel
pg_dump, after being read and handled, were not being free'd.
This patch corrects this relatively minor memory leak.

Leak found by the Coverity scanner.

Back patch to 9.3 where parallel pg_dump was introduced.

src/bin/pg_dump/parallel.c

index ceab58b157c3412ccbcb427d4a77d878813754da..7208b0fec236e7cff77c799d6b2fb7bd010e70bd 100644 (file)
@@ -922,6 +922,9 @@ WaitForCommands(ArchiveHandle *AH, int pipefd[2])
                        exit_horribly(modulename,
                                                  "unrecognized command on communication channel: %s\n",
                                                  command);
+
+               /* command was pg_malloc'd and we are responsible for free()ing it. */
+               free(command);
        }
 }