TDB_DATA data;
char *cfgstr;
uint32_t hwm;
+ TALLOC_CTX *frame = talloc_stackframe();
if (db == NULL || cfg == NULL) {
goto done;
goto done;
}
- status = idmap_autorid_loadconfig(db, talloc_tos(), &storedconfig);
+ status = idmap_autorid_loadconfig(db, frame, &storedconfig);
if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
DEBUG(5, ("No configuration found. Storing initial "
"configuration.\n"));
DEBUG(1, ("New configuration values for rangesize or "
"minimum uid value conflict with previously "
"used values! Not storing new config.\n"));
- talloc_free(storedconfig);
status = NT_STATUS_INVALID_PARAMETER;
goto done;
}
- talloc_free(storedconfig);
-
status = dbwrap_fetch_uint32_bystring(db, HWM, &hwm);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("Fatal error while fetching current "
}
cfgstr =
- talloc_asprintf(talloc_tos(),
+ talloc_asprintf(frame,
"minvalue:%u rangesize:%u maxranges:%u",
cfg->minvalue, cfg->rangesize, cfg->maxranges);
- if (!cfgstr) {
- return NT_STATUS_NO_MEMORY;
+ if (cfgstr == NULL) {
+ status = NT_STATUS_NO_MEMORY;
+ goto done;
}
data = string_tdb_data(cfgstr);
status = dbwrap_trans_store_bystring(db, CONFIGKEY, data, TDB_REPLACE);
- talloc_free(cfgstr);
-
done:
+ talloc_free(frame);
return status;
}