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

ldb: Don’t decrement reference count until object is no longer needed

If ‘tmp’ happens to be garbage-collected, ‘name’ will become invalid.

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:56:49 +12:00 committed by Andrew Bartlett
parent 1cb91c6a78
commit 41e0951d91

View File

@ -4363,10 +4363,10 @@ static PyObject *py_register_module(PyObject *module, PyObject *args)
TALLOC_FREE(ops);
return NULL;
}
Py_XDECREF(tmp);
Py_INCREF(input);
ops->name = talloc_strdup(ops, name);
Py_XDECREF(tmp);
ops->private_data = input;
ops->init_context = py_module_init;
ops->search = py_module_search;