summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/libnet/libnet_dssync.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source3/libnet/libnet_dssync.c b/source3/libnet/libnet_dssync.c
index 3641505d99..684a2cc63b 100644
--- a/source3/libnet/libnet_dssync.c
+++ b/source3/libnet/libnet_dssync.c
@@ -696,18 +696,25 @@ NTSTATUS libnet_dssync(TALLOC_CTX *mem_ctx,
struct dssync_context *ctx)
{
NTSTATUS status;
+ TALLOC_CTX *tmp_ctx;
- status = libnet_dssync_init(mem_ctx, ctx);
+ tmp_ctx = talloc_new(mem_ctx);
+ if (!tmp_ctx) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ status = libnet_dssync_init(tmp_ctx, ctx);
if (!NT_STATUS_IS_OK(status)) {
goto out;
}
- status = libnet_dssync_process(mem_ctx, ctx);
+ status = libnet_dssync_process(tmp_ctx, ctx);
if (!NT_STATUS_IS_OK(status)) {
goto out;
}
out:
+ TALLOC_FREE(tmp_ctx);
return status;
}