Skip to content

Commit fcd77a6

Browse files
committed
Fix minor memory leaks in pg_dump.
Coverity reported the two oversights in getPublicationTables. Valgrind found the one in determineNotNullFlags. The mistakes in getPublicationTables seem too minor to be worth back-patching. determineNotNullFlags could be run enough times to matter, but that code is new in v18. So, no back-patch.
1 parent c45963c commit fcd77a6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/bin/pg_dump/pg_dump.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4682,6 +4682,8 @@ getPublicationTables(Archive *fout, TableInfo tblinfo[], int numTables)
46824682
appendPQExpBufferStr(attribs, fmtId(attnames[k]));
46834683
}
46844684
pubrinfo[j].pubrattrs = attribs->data;
4685+
free(attribs); /* but not attribs->data */
4686+
free(attnames);
46854687
}
46864688
else
46874689
pubrinfo[j].pubrattrs = NULL;
@@ -9424,6 +9426,7 @@ determineNotNullFlags(Archive *fout, PGresult *res, int r,
94249426
tbinfo->notnull_constrs[j] =
94259427
pstrdup(PQgetvalue(res, r, i_notnull_name));
94269428
}
9429+
free(default_name);
94279430
}
94289431
}
94299432
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy