BUG: https://bugzilla.samba.org/show_bug.cgi?id=12932
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
if (!PyArg_ParseTuple(args, "O", &input))
return NULL;
- ops = talloc_zero(talloc_autofree_context(), struct ldb_module_ops);
+ ops = talloc_zero(NULL, struct ldb_module_ops);
if (ops == NULL) {
PyErr_NoMemory();
return NULL;
ops->del_transaction = py_module_del_transaction;
ret = ldb_register_module(ops);
+ if (ret != LDB_SUCCESS) {
+ TALLOC_FREE(ops);
+ }
PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ret, NULL);