Avoid a memory leak
This commit is contained in:
parent
307e18717f
commit
4b51aea95a
|
@ -188,9 +188,11 @@ static PgSQLStatement * _pgsql_prepare_new(PgSQL * pgsql,
|
||||||
|| PQresultStatus(statement->res) != PGRES_COMMAND_OK)
|
|| PQresultStatus(statement->res) != PGRES_COMMAND_OK)
|
||||||
{
|
{
|
||||||
error_set_code(1, "%s", PQerrorMessage(pgsql->handle));
|
error_set_code(1, "%s", PQerrorMessage(pgsql->handle));
|
||||||
|
free(q);
|
||||||
_pgsql_prepare_delete(pgsql, statement);
|
_pgsql_prepare_delete(pgsql, statement);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
free(q);
|
||||||
return statement;
|
return statement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user