Skip to content

Commit 152d24f

Browse files
committed
Fix minor leak in pg_dump
Move allocation to after we check the remote server version, to avoid a possible, very minor, memory leak. This makes us more consistent throughout as most places in pg_dump are done in the same way (due, in part, to previous fixes like this). Spotted by the Coverity scanner.
1 parent a7e5f7b commit 152d24f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/bin/pg_dump/pg_dump.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3602,7 +3602,7 @@ getConversions(Archive *fout, int *numConversions)
36023602
PGresult *res;
36033603
int ntups;
36043604
int i;
3605-
PQExpBuffer query = createPQExpBuffer();
3605+
PQExpBuffer query;
36063606
ConvInfo *convinfo;
36073607
int i_tableoid;
36083608
int i_oid;
@@ -3617,6 +3617,8 @@ getConversions(Archive *fout, int *numConversions)
36173617
return NULL;
36183618
}
36193619

3620+
query = createPQExpBuffer();
3621+
36203622
/*
36213623
* find all conversions, including builtin conversions; we filter out
36223624
* system-defined conversions at dump-out time.

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