From 0c72828e3de3e20b72d2a1f1bb80fc5685bfdbea Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Wed, 23 Jul 2003 01:26:46 +0000 Subject: 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) --- source3/python/py_smb.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source3/python') diff --git a/source3/python/py_smb.c b/source3/python/py_smb.c index d37b73cceb7..af2949f708c 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); } -- cgit