summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/hstore_plpython/hstore_plpython.c4
-rw-r--r--contrib/ltree_plpython/ltree_plpython.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/contrib/hstore_plpython/hstore_plpython.c b/contrib/hstore_plpython/hstore_plpython.c
index 22366bd40f7..218e6612b14 100644
--- a/contrib/hstore_plpython/hstore_plpython.c
+++ b/contrib/hstore_plpython/hstore_plpython.c
@@ -93,6 +93,10 @@ hstore_to_plpython(PG_FUNCTION_ARGS)
PyObject *dict;
dict = PyDict_New();
+ if (!dict)
+ ereport(ERROR,
+ (errcode(ERRCODE_OUT_OF_MEMORY),
+ errmsg("out of memory")));
for (i = 0; i < count; i++)
{
diff --git a/contrib/ltree_plpython/ltree_plpython.c b/contrib/ltree_plpython/ltree_plpython.c
index ae9b90dd10b..e88636a0a96 100644
--- a/contrib/ltree_plpython/ltree_plpython.c
+++ b/contrib/ltree_plpython/ltree_plpython.c
@@ -46,6 +46,10 @@ ltree_to_plpython(PG_FUNCTION_ARGS)
ltree_level *curlevel;
list = PyList_New(in->numlevel);
+ if (!list)
+ ereport(ERROR,
+ (errcode(ERRCODE_OUT_OF_MEMORY),
+ errmsg("out of memory")));
curlevel = LTREE_FIRST(in);
for (i = 0; i < in->numlevel; i++)