summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2003-02-20 03:35:11 +0000
committerMartin Pool <mbp@samba.org>2003-02-20 03:35:11 +0000
commitfa500c77e338337cafe5b46cadf9b104e920e823 (patch)
tree5a30b3d5516417afc3b5b2a34593f0cf7e35a45a
parent7406fabe7ccdd99a19cc1df5f4339ac7e064e6b1 (diff)
downloadsamba-fa500c77e338337cafe5b46cadf9b104e920e823.tar.gz
samba-fa500c77e338337cafe5b46cadf9b104e920e823.tar.xz
samba-fa500c77e338337cafe5b46cadf9b104e920e823.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.)
-rw-r--r--source/python/py_tdbpack.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/python/py_tdbpack.c b/source/python/py_tdbpack.c
index 6181a4918e6..243cb446833 100644
--- a/source/python/py_tdbpack.c
+++ b/source/python/py_tdbpack.c
@@ -1,7 +1,7 @@
/* -*- c-file-style: "python"; indent-tabs-mode: nil; -*-
Python wrapper for Samba tdb pack/unpack functions
- Copyright (C) Martin Pool 2002
+ Copyright (C) Martin Pool 2002, 2003
NOTE PYTHON STYLE GUIDE
@@ -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: