aboutsummaryrefslogtreecommitdiff
path: root/contrib/ltree_plpython/ltree_plpython.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ltree_plpython/ltree_plpython.c')
-rw-r--r--contrib/ltree_plpython/ltree_plpython.c4
1 files changed, 4 insertions, 0 deletions
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++)