if (self->mem_ctx != NULL) {
talloc_free(self->mem_ctx);
}
+ self->data = NULL;
self->ob_type->tp_free(self);
}
static PyObject *py_ldb_control_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
char *data = NULL;
- const char *array[2];
const char * const kwnames[] = { "ldb", "data", NULL };
struct ldb_control *parsed_controls;
PyLdbControlObject *ret;
ret->mem_ctx = mem_ctx;
- ret->data = talloc_steal(mem_ctx, parsed_controls);
+ ret->data = talloc_move(mem_ctx, &parsed_controls);
if (ret->data == NULL) {
Py_DECREF(ret);
PyErr_NoMemory();
ctrl = (PyLdbControlObject *)PyLdbControl.tp_alloc(&PyLdbControl, 0);
if (ctrl == NULL) {
+ talloc_free(ctl_ctx);
PyErr_NoMemory();
return NULL;
}