1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-08 11:42:09 +03:00

Fix thinko in new ECPG "PREPARE AS" code.

ecpg_register_prepared_stmt() is pretty obviously checking the wrong
variable while trying to detect malloc failure.  Error in commit
a1dc6ab46, spotted by Coverity.
This commit is contained in:
Tom Lane
2019-05-26 10:06:37 -04:00
parent 9679345f3c
commit 331695a4d9

View File

@ -85,7 +85,7 @@ ecpg_register_prepared_stmt(struct statement *stmt)
return false; return false;
prep_stmt = (struct statement *) ecpg_alloc(sizeof(struct statement), lineno); prep_stmt = (struct statement *) ecpg_alloc(sizeof(struct statement), lineno);
if (!stmt) if (!prep_stmt)
{ {
ecpg_free(this); ecpg_free(this);
return false; return false;