From 2a781b5bb260209be0d856c6a43d15194d6848e0 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 c5f1c165105..181da564c00 100644 --- a/src/interfaces/ecpg/ecpglib/execute.c +++ b/src/interfaces/ecpg/ecpglib/execute.c @@ -1489,6 +1489,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