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
This commit is contained in:
parent
59f71a0d0b
commit
4a0a5f21fa
@ -240,6 +240,12 @@ vacuumlo(const char *database, const struct _param * param)
|
|||||||
fprintf(stderr, "Out of memory\n");
|
fprintf(stderr, "Out of memory\n");
|
||||||
PQclear(res);
|
PQclear(res);
|
||||||
PQfinish(conn);
|
PQfinish(conn);
|
||||||
|
if (schema != NULL)
|
||||||
|
PQfreemem(schema);
|
||||||
|
if (schema != NULL)
|
||||||
|
PQfreemem(table);
|
||||||
|
if (schema != NULL)
|
||||||
|
PQfreemem(field);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -256,6 +262,9 @@ vacuumlo(const char *database, const struct _param * param)
|
|||||||
PQclear(res2);
|
PQclear(res2);
|
||||||
PQclear(res);
|
PQclear(res);
|
||||||
PQfinish(conn);
|
PQfinish(conn);
|
||||||
|
PQfreemem(schema);
|
||||||
|
PQfreemem(table);
|
||||||
|
PQfreemem(field);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
PQclear(res2);
|
PQclear(res2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user