SVN: ZODB/trunk/src/persistent/cPickleCache.c Fixed a reference leak.

Jim Fulton <[email protected]>
Newsgroups gmane.comp.python.zope.zodb.cvs
Message-ID <[email protected]>
Log message for revision 116134:
  Fixed a reference leak.
  

Changed:
  U   ZODB/trunk/src/persistent/cPickleCache.c

-=-
Modified: ZODB/trunk/src/persistent/cPickleCache.c
===================================================================
--- ZODB/trunk/src/persistent/cPickleCache.c	2010-09-02 13:55:29 UTC (rev 116133)
+++ ZODB/trunk/src/persistent/cPickleCache.c	2010-09-02 13:55:30 UTC (rev 116134)
@@ -354,6 +354,7 @@
 {
   static PyObject *_p_invalidate = NULL;
   PyObject *meth, *v;
+  int result;
 
   v = PyDict_GetItem(self->data, key);
   if (v == NULL)
@@ -391,7 +392,9 @@
 
   v = PyObject_CallObject(meth, NULL);
   Py_DECREF(meth);
-  return v == NULL ? -1 : 0;
+  result = v == NULL ? -1 : 0;
+  Py_DECREF(v);
+  return result;
 }
 
 static PyObject *
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.