summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2011-08-03 10:50:31 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-08-03 07:49:12 +0200
commitf854209996491b34b7326c956d512f3d77db600e (patch)
tree1b3c5e497e71096c60e507603724e51110bfcd3c /source4/libcli
parentcff7adb7ec79feecff73415b2ef4602c2fd4b2ae (diff)
downloadsamba-f854209996491b34b7326c956d512f3d77db600e.tar.gz
samba-f854209996491b34b7326c956d512f3d77db600e.tar.bz2
samba-f854209996491b34b7326c956d512f3d77db600e.zip
s4-libcli: Fix the fd leak. Close open file descriptor before return.
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Wed Aug 3 07:49:12 CEST 2011 on sn-devel-104
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/pysmb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source4/libcli/pysmb.c b/source4/libcli/pysmb.c
index 91ecc83d01..afa85ab5da 100644
--- a/source4/libcli/pysmb.c
+++ b/source4/libcli/pysmb.c
@@ -346,10 +346,10 @@ static PyObject *py_smb_getacl(py_talloc_Object *self, PyObject *args, PyObject
status = smb_raw_query_secdesc(spdata->tree, self->talloc_ctx, &fio);
- PyErr_NTSTATUS_IS_ERR_RAISE(status);
-
smbcli_close(spdata->tree, fnum);
+ PyErr_NTSTATUS_IS_ERR_RAISE(status);
+
return py_return_ndr_struct("samba.dcerpc.security", "descriptor",
self->talloc_ctx, fio.query_secdesc.out.sd);
}
@@ -414,6 +414,8 @@ static PyObject *py_smb_setacl(py_talloc_Object *self, PyObject *args, PyObject
fio.set_secdesc.in.sd = sd;
status = smb_raw_set_secdesc(spdata->tree, &fio);
+ smbcli_close(spdata->tree, fnum);
+
PyErr_NTSTATUS_IS_ERR_RAISE(status);
Py_RETURN_NONE;