1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

libnet dssync: start memory allocation cleanup: use tmp ctx in libnet_dssync().

Don't leak temporary data to callers but use a temporary context
that is freed at the end.

Michael
This commit is contained in:
Michael Adam 2008-08-01 17:13:42 +02:00
parent 635baf6b7d
commit 2d98ad57f5

View File

@ -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;
}