(Merge from APPLIANCE_HEAD)
authorMartin Pool <mbp@samba.org>
Thu, 20 Feb 2003 03:33:20 +0000 (03:33 +0000)
committerMartin Pool <mbp@samba.org>
Thu, 20 Feb 2003 03:33:20 +0000 (03:33 +0000)
CR1829: Fix memory leak when unpacking 'B' buffers in Python.

(PyList_Append creates a new reference to the added object, and so we
have to release the existing one.)
(This used to be commit 55e114f596e0edfdf176cabdbcfe7f01fae6f8aa)

source3/python/py_tdbpack.c

index 6181a4918e6a7e6870bbd51e6f0370a7be01d75d..8aa4ee316a8ea5aeb5407f065481e067faca00e9 100644 (file)
@@ -638,6 +638,9 @@ pytdbunpack_buffer(char **pbuf, int *plen, PyObject *val_list)
        if (PyList_Append(val_list, str_obj) == -1)
                goto failed;
        
+       Py_DECREF(len_obj);
+       Py_DECREF(str_obj);
+       
        return val_list;
 
   failed: