]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ldb: Fix leaks
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Mon, 31 Jul 2023 21:51:15 +0000 (09:51 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 8 Aug 2023 04:39:37 +0000 (04:39 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb/pyldb.c

index 38a4f3d29ced3b694d75ac4a5c84c27e12f4c165..6215efb3d4da8285ac1d8931102fca4c77558e37 100644 (file)
@@ -4354,10 +4354,13 @@ static PyObject *py_register_module(PyObject *module, PyObject *args)
 
        tmp = PyObject_GetAttrString(input, discard_const_p(char, "name"));
        if (tmp == NULL) {
+               TALLOC_FREE(ops);
                return NULL;
        }
        name = PyUnicode_AsUTF8(tmp);
        if (name == NULL) {
+               Py_DECREF(tmp);
+               TALLOC_FREE(ops);
                return NULL;
        }
        Py_XDECREF(tmp);
@@ -4379,6 +4382,7 @@ static PyObject *py_register_module(PyObject *module, PyObject *args)
 
        ret = ldb_register_module(ops);
        if (ret != LDB_SUCCESS) {
+               Py_DECREF(input);
                TALLOC_FREE(ops);
        }