summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2011-06-07 15:16:24 +0200
committerMichael Adam <obnox@samba.org>2011-06-07 15:55:07 +0200
commit65490ea4e67bf82cf8fb0b8e4e74047c3f63c509 (patch)
treec51a1aefd6f0b97095058ae7e3099eaef2497d43
parent632f672b0859cee995788a00ecd464a0a8d5c74a (diff)
downloadsamba-65490ea4e67bf82cf8fb0b8e4e74047c3f63c509.tar.gz
samba-65490ea4e67bf82cf8fb0b8e4e74047c3f63c509.tar.bz2
samba-65490ea4e67bf82cf8fb0b8e4e74047c3f63c509.zip
s3:idmap_autorid: add a talloc_stackframe() to idmap_autorid_initialize()
-rw-r--r--source3/winbindd/idmap_autorid.c11
1 files changed, 6 insertions, 5 deletions
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;
}