From 65490ea4e67bf82cf8fb0b8e4e74047c3f63c509 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 7 Jun 2011 15:16:24 +0200 Subject: s3:idmap_autorid: add a talloc_stackframe() to idmap_autorid_initialize() --- source3/winbindd/idmap_autorid.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'source3/winbindd') diff --git a/source3/winbindd/idmap_autorid.c b/source3/winbindd/idmap_autorid.c index 1f4af33510..92cc9bcb00 100644 --- a/source3/winbindd/idmap_autorid.c +++ b/source3/winbindd/idmap_autorid.c @@ -435,11 +435,13 @@ static NTSTATUS idmap_autorid_initialize(struct idmap_domain *dom) struct autorid_global_config *storedconfig = NULL; NTSTATUS status; uint32_t hwm; + TALLOC_CTX *frame = talloc_stackframe(); - config = TALLOC_ZERO_P(dom, struct autorid_global_config); + config = TALLOC_ZERO_P(frame, struct autorid_global_config); if (!config) { DEBUG(0, ("Out of memory!\n")); - return NT_STATUS_NO_MEMORY; + status = NT_STATUS_NO_MEMORY; + goto error; } status = idmap_autorid_db_init(); @@ -480,7 +482,7 @@ static NTSTATUS idmap_autorid_initialize(struct idmap_domain *dom) config->minvalue, config->rangesize, config->maxranges)); /* read previously stored config and current HWM */ - storedconfig = idmap_autorid_loadconfig(talloc_tos()); + storedconfig = idmap_autorid_loadconfig(frame); if (!dbwrap_fetch_uint32(autorid_db, HWM, &hwm)) { DEBUG(1, ("Fatal error while fetching current " @@ -530,8 +532,7 @@ static NTSTATUS idmap_autorid_initialize(struct idmap_domain *dom) return NT_STATUS_OK; error: - talloc_free(config); - talloc_free(storedconfig); + talloc_free(frame); return status; } -- cgit