summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/talloc/pytalloc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/talloc/pytalloc.c b/lib/talloc/pytalloc.c
index b0b7394875..ae59b69625 100644
--- a/lib/talloc/pytalloc.c
+++ b/lib/talloc/pytalloc.c
@@ -21,6 +21,8 @@
#include "replace.h"
#include <talloc.h>
#include "pytalloc.h"
+#include "lib/util/debug.h"
+#include "lib/util/util.h"
/**
* Simple dealloc for talloc-wrapping PyObjects
@@ -28,7 +30,7 @@
void py_talloc_dealloc(PyObject* self)
{
py_talloc_Object *obj = (py_talloc_Object *)self;
- talloc_free(obj->talloc_ctx);
+ SMB_ASSERT(talloc_unlink(NULL, obj->talloc_ctx) != -1);
obj->talloc_ctx = NULL;
self->ob_type->tp_free(self);
}