Fix memory leaks introduced by commit eca2b9b
This commit is contained in:
parent
b779168ffe
commit
02d5ab6a86
@ -2974,7 +2974,10 @@ lookup_function_oid(const char *desc, Oid *foid)
|
|||||||
appendPQExpBuffer(query, "::pg_catalog.%s::pg_catalog.oid",
|
appendPQExpBuffer(query, "::pg_catalog.%s::pg_catalog.oid",
|
||||||
strchr(desc, '(') ? "regprocedure" : "regproc");
|
strchr(desc, '(') ? "regprocedure" : "regproc");
|
||||||
if (!lookup_function_echo_hidden(query->data))
|
if (!lookup_function_echo_hidden(query->data))
|
||||||
|
{
|
||||||
|
destroyPQExpBuffer(query);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
res = PQexec(pset.db, query->data);
|
res = PQexec(pset.db, query->data);
|
||||||
if (PQresultStatus(res) == PGRES_TUPLES_OK && PQntuples(res) == 1)
|
if (PQresultStatus(res) == PGRES_TUPLES_OK && PQntuples(res) == 1)
|
||||||
*foid = atooid(PQgetvalue(res, 0, 0));
|
*foid = atooid(PQgetvalue(res, 0, 0));
|
||||||
@ -3005,7 +3008,10 @@ get_create_function_cmd(Oid oid, PQExpBuffer buf)
|
|||||||
printfPQExpBuffer(query, "SELECT pg_catalog.pg_get_functiondef(%u)", oid);
|
printfPQExpBuffer(query, "SELECT pg_catalog.pg_get_functiondef(%u)", oid);
|
||||||
|
|
||||||
if (!lookup_function_echo_hidden(query->data))
|
if (!lookup_function_echo_hidden(query->data))
|
||||||
|
{
|
||||||
|
destroyPQExpBuffer(query);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
res = PQexec(pset.db, query->data);
|
res = PQexec(pset.db, query->data);
|
||||||
if (PQresultStatus(res) == PGRES_TUPLES_OK && PQntuples(res) == 1)
|
if (PQresultStatus(res) == PGRES_TUPLES_OK && PQntuples(res) == 1)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user