Hi all,

Coverity is complaining that getTransforms in pg_dump.c leaks a
PQExpBuffer allocation.
Please find attached a patch to fix the leak.
Regards,
-- 
Michael
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 977b72e..dccb472 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -6596,7 +6596,7 @@ getTransforms(Archive *fout, int *numTransforms)
 	PGresult   *res;
 	int			ntups;
 	int			i;
-	PQExpBuffer query = createPQExpBuffer();
+	PQExpBuffer query;
 	TransformInfo   *transforminfo;
 	int			i_tableoid;
 	int			i_oid;
@@ -6612,6 +6612,8 @@ getTransforms(Archive *fout, int *numTransforms)
 		return NULL;
 	}
 
+	query = createPQExpBuffer();
+
 	/* Make sure we are in proper schema */
 	selectSourceSchema(fout, "pg_catalog");
 
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to