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:
parent
d5c309a547
commit
1cb91c6a78
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user