From c4428c58bba8a951c06df6c0689bb0d818049deb Mon Sep 17 00:00:00 2001
From: Guido van Rossum <guido@python.org>
Date: Tue, 25 Apr 2000 15:59:32 +0000
Subject: Charles G Waldman: Doing a PyObject_New then PyMem_DEL causes havoc
 if you are trying to use Py_TRACE_REFS.

---
 Modules/pcremodule.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Modules/pcremodule.c b/Modules/pcremodule.c
index f44726e..4d2aa72 100644
--- a/Modules/pcremodule.c
+++ b/Modules/pcremodule.c
@@ -204,7 +204,7 @@ PyPcre_compile(self, args)
 				 &error, &erroroffset, dictionary);
 	if (rv->regex==NULL) 
 	{
-		PyMem_DEL(rv);
+		Py_DECREF(rv);
 		if (!PyErr_Occurred())
 		{
 			PyObject *errval = Py_BuildValue("si", error, erroroffset);
@@ -217,7 +217,7 @@ PyPcre_compile(self, args)
 	if (rv->regex_extra==NULL && error!=NULL) 
 	{
 		PyObject *errval = Py_BuildValue("si", error, 0);
-		PyMem_DEL(rv);
+		Py_DECREF(rv);
 		PyErr_SetObject(ErrorObject, errval);
 		Py_XDECREF(errval);
 		return NULL;
@@ -228,7 +228,7 @@ PyPcre_compile(self, args)
 		PyObject *errval = Py_BuildValue("si", error, rv->num_groups);
 		PyErr_SetObject(ErrorObject, errval);
 		Py_XDECREF(errval);
-		PyMem_DEL(rv);
+		Py_DECREF(rv);
 		return NULL;
 	}
 	return (PyObject *)rv;
-- 
cgit v0.12

