summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/util/talloc_stack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/util/talloc_stack.c b/lib/util/talloc_stack.c
index 596efbf6cd..58d22e378a 100644
--- a/lib/util/talloc_stack.c
+++ b/lib/util/talloc_stack.c
@@ -181,7 +181,7 @@ TALLOC_CTX *talloc_tos(void)
struct talloc_stackframe *ts =
(struct talloc_stackframe *)SMB_THREAD_GET_TLS(global_ts);
- if (ts == NULL) {
+ if (ts == NULL || ts->talloc_stacksize == 0) {
talloc_stackframe();
ts = (struct talloc_stackframe *)SMB_THREAD_GET_TLS(global_ts);
DEBUG(0, ("no talloc stackframe around, leaking memory\n"));