s3: Fix memleaks in pylibsmb.c
authorVolker Lendecke <vl@samba.org>
Mon, 20 Aug 2012 11:43:41 +0000 (13:43 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 4 Sep 2012 22:14:59 +0000 (15:14 -0700)
Cut&Paste errors from the read&x routine

Signed-off-by: Jeremy Allison <jra@samba.org>
source3/libsmb/pylibsmb.c

index be04e5b7db2ea39147b9659d21598c20856e6ed3..d8e64b35682c6fd2e6a96e46ffb3f84e310573ff 100644 (file)
@@ -577,9 +577,9 @@ static PyObject *py_cli_ftruncate(struct py_cli_state *self, PyObject *args,
                return NULL;
        }
        status = cli_ftruncate_recv(req);
+       TALLOC_FREE(req);
 
        if (!NT_STATUS_IS_OK(status)) {
-               TALLOC_FREE(req);
                PyErr_SetNTSTATUS(status);
                return NULL;
        }
@@ -609,9 +609,9 @@ static PyObject *py_cli_delete_on_close(struct py_cli_state *self,
                return NULL;
        }
        status = cli_nt_delete_on_close_recv(req);
+       TALLOC_FREE(req);
 
        if (!NT_STATUS_IS_OK(status)) {
-               TALLOC_FREE(req);
                PyErr_SetNTSTATUS(status);
                return NULL;
        }