mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-23 19:39:53 +08:00
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");
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user