summaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/pg_dumpall.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2012-03-13 21:34:54 +0200
committerPeter Eisentraut <peter_e@gmx.net>2012-03-13 21:36:43 +0200
commitacfaa596ccd90e161bcc09bb00e755e65d9c068c (patch)
tree385a8446794c72338ea032fb41ceeb7a3063985b /src/bin/pg_dump/pg_dumpall.c
parent5cd72c7a7c7bd76ab028e1dc59d90a47750acebe (diff)
pg_dump: Fix some minor memory leaks
Although we often don't care about freeing all memory in pg_dump, these functions already freed the same memory in other code paths, so we might as well do it consistently. found by Coverity
Diffstat (limited to 'src/bin/pg_dump/pg_dumpall.c')
-rw-r--r--src/bin/pg_dump/pg_dumpall.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index 4f8dd600686..4100fca27dc 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -1525,12 +1525,17 @@ makeAlterConfigCommand(PGconn *conn, const char *arrayitem,
{
char *pos;
char *mine;
- PQExpBuffer buf = createPQExpBuffer();
+ PQExpBuffer buf;
mine = pg_strdup(arrayitem);
pos = strchr(mine, '=');
if (pos == NULL)
+ {
+ free(mine);
return;
+ }
+
+ buf = createPQExpBuffer();
*pos = 0;
appendPQExpBuffer(buf, "ALTER %s %s ", type, fmtId(name));