[Zodb-checkins] CVS: Zope/lib/python/BTrees - BTreeTemplate.c:1.73

Tim Peters tim.one@comcast.net
Thu, 10 Apr 2003 19:36:56 -0400


Update of /cvs-repository/Zope/lib/python/BTrees
In directory cvs.zope.org:/tmp/cvs-serv13484/lib/python/BTrees

Modified Files:
	BTreeTemplate.c 
Log Message:
BTree_deleteNextBucket():  This failed to decref the temp result from
BTree_lastBucket().  In unusual cases, this could cause a chain of buckets
to leak (the DegenerateBTree tests appeared to be the only ones that
provoked this, and there it leaked 285 IISet buckets).  Other uses of
BTree_lastBucket() appear to be refcount-correct.


=== Zope/lib/python/BTrees/BTreeTemplate.c 1.72 => 1.73 ===
--- Zope/lib/python/BTrees/BTreeTemplate.c:1.72	Fri Oct  4 20:39:56 2002
+++ Zope/lib/python/BTrees/BTreeTemplate.c	Thu Apr 10 19:36:55 2003
@@ -490,15 +490,17 @@
 
   PER_USE_OR_RETURN(self, -1);
 
-  UNLESS (b=BTree_lastBucket(self)) goto err;
+  UNLESS (b = BTree_lastBucket(self)) goto err;
   if (Bucket_deleteNextBucket(b) < 0) goto err;
 
+  Py_DECREF(b);
   PER_ALLOW_DEACTIVATION(self);
   PER_ACCESSED(self);
 
   return 0;
 
  err:
+  Py_XDECREF(b);
   PER_ALLOW_DEACTIVATION(self);
   return -1;
 }