aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_dump/parallel.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/bin/pg_dump/parallel.c b/src/bin/pg_dump/parallel.c
index d252f9b7896..6f2634bb641 100644
--- a/src/bin/pg_dump/parallel.c
+++ b/src/bin/pg_dump/parallel.c
@@ -1288,7 +1288,7 @@ readMessageFromPipe(int fd)
/* worker has closed the connection or another error happened */
if (ret <= 0)
- return NULL;
+ break;
Assert(ret == 1);
@@ -1303,6 +1303,14 @@ readMessageFromPipe(int fd)
msg = (char *) realloc(msg, bufsize);
}
}
+
+ /*
+ * Worker has closed the connection, make sure to clean up before return
+ * since we are not returning msg (but did allocate it).
+ */
+ free(msg);
+
+ return NULL;
}
#ifdef WIN32