From 6d5417e634b3841dcc44bdb43f5586bcde33ddb4 Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Sun, 6 Apr 2025 09:08:02 -0400 Subject: [PATCH] Fix a couple of memory leaks in pg_restore.c per complaint from Coverity. --- src/bin/pg_dump/pg_restore.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c index db8356405d9..c42e34b8a40 100644 --- a/src/bin/pg_dump/pg_restore.c +++ b/src/bin/pg_dump/pg_restore.c @@ -991,6 +991,8 @@ get_dbnames_list_to_restore(PGconn *conn, break; } + destroyPQExpBuffer(db_lit); + /* * Mark db to be skipped or increment the counter of dbs to be * restored @@ -1006,6 +1008,8 @@ get_dbnames_list_to_restore(PGconn *conn, } } + destroyPQExpBuffer(query); + return count_db; } -- 2.30.2