summaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/ecpglib/execute.c
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2015-06-15 14:21:03 +0200
committerMichael Meskes <meskes@postgresql.org>2015-06-15 14:22:24 +0200
commit2a781b5bb260209be0d856c6a43d15194d6848e0 (patch)
tree197d2ad390dbeeaeaf5440b2a1750f7a700943e7 /src/interfaces/ecpg/ecpglib/execute.c
parent853222ce0012d56f26138709eecc7939f04a996d (diff)
Check for out of memory when allocating sqlca.
Patch by Michael Paquier
Diffstat (limited to 'src/interfaces/ecpg/ecpglib/execute.c')
-rw-r--r--src/interfaces/ecpg/ecpglib/execute.c7
1 files changed, 7 insertions, 0 deletions
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))
{