diff options
author | Tim Potter <tpot@samba.org> | 2003-07-23 01:26:46 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2003-07-23 01:26:46 +0000 |
commit | 0c72828e3de3e20b72d2a1f1bb80fc5685bfdbea (patch) | |
tree | 3a02c7404d8ed269546b61ae3dab6d228e3fd011 /source3 | |
parent | c51ffbbdaaf43e24114becbbff976e2254c199ea (diff) | |
download | samba-0c72828e3de3e20b72d2a1f1bb80fc5685bfdbea.tar.gz samba-0c72828e3de3e20b72d2a1f1bb80fc5685bfdbea.tar.bz2 samba-0c72828e3de3e20b72d2a1f1bb80fc5685bfdbea.zip |
Fix two memory leaks in the smb module:
- free talloc context when cli_query_secdesc() fails
- dispose of cli_state when python cli_state_object is garbage collected
(This used to be commit 36052f95ffad4f227596e8038d3f056312d0ad82)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/python/py_smb.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/python/py_smb.c b/source3/python/py_smb.c index d37b73cceb..af2949f708 100644 --- a/source3/python/py_smb.c +++ b/source3/python/py_smb.c @@ -238,7 +238,8 @@ static PyObject *py_smb_query_secdesc(PyObject *self, PyObject *args, if (cli_is_error(cli->cli)) { PyErr_SetString(PyExc_RuntimeError, "query_secdesc failed"); - return NULL; + result = NULL; + goto done; } if (!secdesc) { @@ -347,6 +348,11 @@ static PyMethodDef smb_methods[] = { static void py_cli_state_dealloc(PyObject* self) { + cli_state_object *cli = (cli_state_object *)self; + + if (cli->cli) + cli_shutdown(cli->cli); + PyObject_Del(self); } |