summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/pg_dump/dumputils.c2
-rw-r--r--src/bin/pg_dump/pg_dump.c14
2 files changed, 10 insertions, 6 deletions
diff --git a/src/bin/pg_dump/dumputils.c b/src/bin/pg_dump/dumputils.c
index 8a93ace9fa0..475d6dbd737 100644
--- a/src/bin/pg_dump/dumputils.c
+++ b/src/bin/pg_dump/dumputils.c
@@ -95,6 +95,8 @@ buildACLCommands(const char *name, const char *subname, const char *nspname,
{
if (!parsePGArray(racls, &raclitems, &nraclitems))
{
+ if (aclitems)
+ free(aclitems);
if (raclitems)
free(raclitems);
return false;
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index d583154fba0..637c79af483 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -15303,8 +15303,6 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo)
int actual_atts; /* number of attrs in this CREATE statement */
const char *reltypename;
char *storage;
- char *srvname;
- char *ftoptions;
int j,
k;
@@ -15361,6 +15359,9 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo)
}
else
{
+ char *ftoptions = NULL;
+ char *srvname = NULL;
+
switch (tbinfo->relkind)
{
case RELKIND_FOREIGN_TABLE:
@@ -15397,13 +15398,9 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo)
}
case RELKIND_MATVIEW:
reltypename = "MATERIALIZED VIEW";
- srvname = NULL;
- ftoptions = NULL;
break;
default:
reltypename = "TABLE";
- srvname = NULL;
- ftoptions = NULL;
}
numParents = tbinfo->numParents;
@@ -15951,6 +15948,11 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo)
tbinfo->attfdwoptions[j]);
}
}
+
+ if (ftoptions)
+ free(ftoptions);
+ if (srvname)
+ free(srvname);
}
/*