From: Robert Haas Date: Wed, 14 Jan 2015 20:14:20 +0000 (-0500) Subject: vacuumlo: Avoid unlikely memory leak. X-Git-Tag: REL9_5_ALPHA1~917 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4a0a5f21fa05070295557ad6ac9b9bbe247938ad;p=thirdparty%2Fpostgresql.git 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 --- 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);