summaryrefslogtreecommitdiff
path: root/source4/libcli/composite/composite.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli/composite/composite.c')
-rw-r--r--source4/libcli/composite/composite.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/libcli/composite/composite.c b/source4/libcli/composite/composite.c
index 26169e78389..966f56cba82 100644
--- a/source4/libcli/composite/composite.c
+++ b/source4/libcli/composite/composite.c
@@ -42,7 +42,11 @@ _PUBLIC_ struct composite_context *composite_create(TALLOC_CTX *mem_ctx,
c = talloc_zero(mem_ctx, struct composite_context);
if (!c) return NULL;
c->state = COMPOSITE_STATE_IN_PROGRESS;
- c->event_ctx = ev;
+ c->event_ctx = talloc_reference(c, ev);
+ if (!c->event_ctx) {
+ talloc_free(c);
+ return NULL;
+ }
return c;
}