postgres.git / summary / log / commit / refs

commit    234e4cf6e1eac2f0e514379a2a533ffb71b33732
Author:   Stephen Frost <sfrost@snowman.net>
Date:     Sun Jul 14 18:35:26 2013 +0000
First released in: 9.4.0, 9.3.0

    During parallel pg_dump, free commands from master
    
    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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bin/pg_dump/parallel.c b/src/bin/pg_dump/parallel.c index ceab58b157c..7208b0fec23 100644 --- a/src/bin/pg_dump/parallel.c +++ b/src/bin/pg_dump/parallel.c @@ -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); } } [parent: 070518ddab2c]