summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/pcremodule.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/pcremodule.c b/Modules/pcremodule.c
index 60b7029..f8bde04 100644
--- a/Modules/pcremodule.c
+++ b/Modules/pcremodule.c
@@ -512,6 +512,10 @@ PyPcre_expand(self, args)
{
PyObject *r, *tuple, *result;
r=PyObject_GetAttrString(match_obj, "group");
+ if (r == NULL) {
+ Py_DECREF(results);
+ return NULL;
+ }
tuple=PyTuple_New(1);
Py_INCREF(value);
PyTuple_SetItem(tuple, 0, value);