pg_dump: add missing "destroyPQExpBuffer(query)" in dumpForeignServer().
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 11 Apr 2016 04:00:08 +0000 (00:00 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 11 Apr 2016 04:00:08 +0000 (00:00 -0400)
Coverity complained about this resource leak (why now, I don't know,
since it's been like that a long time).  Our general policy in pg_dump
is that PQExpBuffers are worth cleaning up, so do it here too.  But
don't bother with a back-patch, because it seems unlikely that very
many databases contain enough FOREIGN SERVER objects to notice.

src/bin/pg_dump/pg_dump.c

index 6c2167616dd802a7c25d09380c338660d36ce931..c999193a23810141e958d258603d64ce2790e5e6 100644 (file)
@@ -14287,6 +14287,7 @@ dumpForeignServer(Archive *fout, ForeignServerInfo *srvinfo)
        destroyPQExpBuffer(q);
        destroyPQExpBuffer(delq);
        destroyPQExpBuffer(labelq);
+       destroyPQExpBuffer(query);
 }
 
 /*