Commit 4a0a5f21 authored by Robert Haas's avatar Robert Haas

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
parent 59f71a0d
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment