1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-18 17:42:25 +03:00

Check for out of memory when allocating sqlca.

Patch by Michael Paquier

Conflicts:
	src/interfaces/ecpg/ecpglib/connect.c
This commit is contained in:
Michael Meskes
2015-06-15 14:21:03 +02:00
parent abf92840a1
commit d278ff3b26
7 changed files with 106 additions and 1 deletions

View File

@ -132,6 +132,13 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
int value_for_indicator = 0;
long log_offset;
if (sqlca == NULL)
{
ecpg_raise(lineno, ECPG_OUT_OF_MEMORY,
ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY, NULL);
return (false);
}
/*
* If we are running in a regression test, do not log the offset variable,
* it depends on the machine's alignment.