diff options
author | Stephen Frost <sfrost@snowman.net> | 2014-01-26 17:58:48 -0500 |
---|---|---|
committer | Stephen Frost <sfrost@snowman.net> | 2014-01-26 17:58:48 -0500 |
commit | 152d24f5ddbc535bb437b57856fa3c7c5c630472 (patch) | |
tree | 1742557ac3a5dbc7cb400af83e6a87b47c8ab39f | |
parent | a7e5f7bf6890fdf14a6c6ecd0854ac3f5f308ccd (diff) | |
download | postgresql-152d24f5ddbc535bb437b57856fa3c7c5c630472.tar.gz postgresql-152d24f5ddbc535bb437b57856fa3c7c5c630472.zip |
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.
-rw-r--r-- | src/bin/pg_dump/pg_dump.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 3862f05fb08..ebbb5b730c3 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -3602,7 +3602,7 @@ getConversions(Archive *fout, int *numConversions) PGresult *res; int ntups; int i; - PQExpBuffer query = createPQExpBuffer(); + PQExpBuffer query; ConvInfo *convinfo; int i_tableoid; int i_oid; @@ -3617,6 +3617,8 @@ getConversions(Archive *fout, int *numConversions) return NULL; } + query = createPQExpBuffer(); + /* * find all conversions, including builtin conversions; we filter out * system-defined conversions at dump-out time. |