Commit 15127f8f authored by Jim Fulton's avatar Jim Fulton

Fixed two leaks in bucket values.

parent 4e3c4025
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
static char BTree_module_documentation[] = static char BTree_module_documentation[] =
"" ""
"\n$Id: BTree.c,v 1.12 1997/12/31 17:18:04 jim Exp $" "\n$Id: BTree.c,v 1.13 1998/02/04 21:11:26 jim Exp $"
; ;
#define PERSISTENT #define PERSISTENT
...@@ -664,10 +664,10 @@ _bucket_set(Bucket *self, PyObject *key, PyObject *v) ...@@ -664,10 +664,10 @@ _bucket_set(Bucket *self, PyObject *key, PyObject *v)
{ {
if(v) if(v)
{ {
Py_INCREF(v);
#ifdef INTVAL #ifdef INTVAL
self->data[i].value=iv; self->data[i].value=iv;
#else #else
Py_INCREF(v);
ASSIGN(self->data[i].value, v); ASSIGN(self->data[i].value, v);
#endif #endif
if(PER_CHANGED(self) < 0) goto err; if(PER_CHANGED(self) < 0) goto err;
...@@ -1236,6 +1236,8 @@ bucket_getstate(Bucket *self, PyObject *args) ...@@ -1236,6 +1236,8 @@ bucket_getstate(Bucket *self, PyObject *args)
PER_ALLOW_DEACTIVATION(self); PER_ALLOW_DEACTIVATION(self);
r=Py_BuildValue("OO",keys,values); r=Py_BuildValue("OO",keys,values);
Py_DECREF(keys);
Py_DECREF(values);
return r; return r;
err: err:
...@@ -1712,7 +1714,7 @@ initBTree() ...@@ -1712,7 +1714,7 @@ initBTree()
#endif #endif
{ {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.12 $"; char *rev="$Revision: 1.13 $";
UNLESS(PyExtensionClassCAPI=PyCObject_Import("ExtensionClass","CAPI")) UNLESS(PyExtensionClassCAPI=PyCObject_Import("ExtensionClass","CAPI"))
return; return;
...@@ -1774,6 +1776,9 @@ initBTree() ...@@ -1774,6 +1776,9 @@ initBTree()
Revision Log: Revision Log:
$Log: BTree.c,v $ $Log: BTree.c,v $
Revision 1.13 1998/02/04 21:11:26 jim
Fixed two leaks in bucket values.
Revision 1.12 1997/12/31 17:18:04 jim Revision 1.12 1997/12/31 17:18:04 jim
Fixed bugs related to deleting items. Fixed bugs related to deleting items.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment