summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2003-02-20 03:33:20 +0000
committerMartin Pool <mbp@samba.org>2003-02-20 03:33:20 +0000
commit9061aae9b4bfed051b4c08b971561297710ef369 (patch)
treef75e24f60d21996a42d69abce581a0dc3b3ce031
parent673cdea310f8447b138cd0c30b5c2313f5c9afe9 (diff)
downloadsamba-9061aae9b4bfed051b4c08b971561297710ef369.tar.gz
samba-9061aae9b4bfed051b4c08b971561297710ef369.tar.bz2
samba-9061aae9b4bfed051b4c08b971561297710ef369.zip
(Merge from APPLIANCE_HEAD)
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)
-rw-r--r--source3/python/py_tdbpack.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/python/py_tdbpack.c b/source3/python/py_tdbpack.c
index 6181a4918e..8aa4ee316a 100644
--- a/source3/python/py_tdbpack.c
+++ b/source3/python/py_tdbpack.c
@@ -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: