summaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/pg_dumpall.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2015-07-02 20:58:51 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2015-07-02 20:58:51 +0300
commitf712289ffad7c3fb6eb3be4f81adb0aa0981c9f7 (patch)
treef7ebf8219c469284f943be3de66c70ad158e2caf /src/bin/pg_dump/pg_dumpall.c
parent1fd0d5ec0373666fe00db4f641490d9e82f53e01 (diff)
downloadpostgresql-f712289ffad7c3fb6eb3be4f81adb0aa0981c9f7.tar.gz
Plug some trivial memory leaks in pg_dump and pg_upgrade.
There's no point in trying to free every small allocation in these programs that are used in a one-shot fashion, but these ones seems like an improvement on readability grounds. Michael Paquier, per Coverity report.
Diffstat (limited to 'src/bin/pg_dump/pg_dumpall.c')
-rw-r--r--src/bin/pg_dump/pg_dumpall.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index d98c83e099..c4b6ae85aa 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -1442,6 +1442,13 @@ dumpCreateDB(PGconn *conn)
free(fdbname);
}
+ if (default_encoding)
+ free(default_encoding);
+ if (default_collate)
+ free(default_collate);
+ if (default_ctype)
+ free(default_ctype);
+
PQclear(res);
destroyPQExpBuffer(buf);