From 94a484222caece19e381a6941b8d826027ac2e75 Mon Sep 17 00:00:00 2001 From: Michael Meskes Date: Mon, 15 Jun 2015 14:21:03 +0200 Subject: Check for out of memory when allocating sqlca. Patch by Michael Paquier --- src/interfaces/ecpg/ecpglib/execute.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/interfaces/ecpg/ecpglib/execute.c') diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c index bcb38d25f87..9a56a5cd4ac 100644 --- a/src/interfaces/ecpg/ecpglib/execute.c +++ b/src/interfaces/ecpg/ecpglib/execute.c @@ -1493,6 +1493,13 @@ ecpg_process_output(struct statement * stmt, bool clear_result) ntuples, act_field; + if (sqlca == NULL) + { + ecpg_raise(stmt->lineno, ECPG_OUT_OF_MEMORY, + ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY, NULL); + return (false); + } + var = stmt->outlist; switch (PQresultStatus(stmt->results)) { -- cgit v1.2.3