diff options
author | Robert Haas <rhaas@postgresql.org> | 2015-01-14 15:14:20 -0500 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2015-01-14 15:14:20 -0500 |
commit | 4a0a5f21fa05070295557ad6ac9b9bbe247938ad (patch) | |
tree | c4af94aa9e6d54c8861759ca1205743e2b72b91a | |
parent | 59f71a0d0b56b2df48db4bf1738aece5551f7a47 (diff) | |
download | postgresql-4a0a5f21fa05070295557ad6ac9b9bbe247938ad.tar.gz postgresql-4a0a5f21fa05070295557ad6ac9b9bbe247938ad.zip |
vacuumlo: Avoid unlikely memory leak.
Spotted by Coverity. This isn't likely to matter in practice, but
there's no harm in fixing it.
Michael Paquier
-rw-r--r-- | contrib/vacuumlo/vacuumlo.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/contrib/vacuumlo/vacuumlo.c b/contrib/vacuumlo/vacuumlo.c index 43130dca8af..ca0d3048b82 100644 --- a/contrib/vacuumlo/vacuumlo.c +++ b/contrib/vacuumlo/vacuumlo.c @@ -240,6 +240,12 @@ vacuumlo(const char *database, const struct _param * param) fprintf(stderr, "Out of memory\n"); PQclear(res); PQfinish(conn); + if (schema != NULL) + PQfreemem(schema); + if (schema != NULL) + PQfreemem(table); + if (schema != NULL) + PQfreemem(field); return -1; } @@ -256,6 +262,9 @@ vacuumlo(const char *database, const struct _param * param) PQclear(res2); PQclear(res); PQfinish(conn); + PQfreemem(schema); + PQfreemem(table); + PQfreemem(field); return -1; } PQclear(res2); |