1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

ldb: Fix leaks

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Joseph Sutton 2023-08-01 09:51:15 +12:00 committed by Andrew Bartlett
parent d5c309a547
commit 1cb91c6a78

View 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);
}