diff options
author | Volker Lendecke <vl@samba.org> | 2011-03-08 21:47:41 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2011-03-18 15:46:36 +0100 |
commit | 10953c60bdf247d030b088c155346a5af470567a (patch) | |
tree | 38e0c22bae6d3489f65fc8fe548e2561b8961fba /source3/winbindd | |
parent | 6ba85beeec7ab11baba548c7443e904d9ea31944 (diff) | |
download | samba-10953c60bdf247d030b088c155346a5af470567a.tar.gz samba-10953c60bdf247d030b088c155346a5af470567a.tar.bz2 samba-10953c60bdf247d030b088c155346a5af470567a.zip |
idmap-autorid: Use talloc_tos() in idmap_autorid_id_to_sid
Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
Diffstat (limited to 'source3/winbindd')
-rw-r--r-- | source3/winbindd/idmap_autorid.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source3/winbindd/idmap_autorid.c b/source3/winbindd/idmap_autorid.c index 5747a0b0c8..e814d0da1f 100644 --- a/source3/winbindd/idmap_autorid.c +++ b/source3/winbindd/idmap_autorid.c @@ -130,8 +130,7 @@ static NTSTATUS idmap_autorid_get_domainrange(struct db_context *db, } -static NTSTATUS idmap_autorid_id_to_sid(TALLOC_CTX * memctx, - struct autorid_global_config *cfg, +static NTSTATUS idmap_autorid_id_to_sid(struct autorid_global_config *cfg, struct id_map *map) { uint32_t range; @@ -157,12 +156,13 @@ static NTSTATUS idmap_autorid_id_to_sid(TALLOC_CTX * memctx, /* determine the range of this uid */ range = ((map->xid.id - cfg->minvalue) / cfg->rangesize); - keystr = talloc_asprintf(memctx, "%u", range); + keystr = talloc_asprintf(talloc_tos(), "%u", range); if (!keystr) { return NT_STATUS_NO_MEMORY; } - data = dbwrap_fetch_bystring(autorid_db, memctx, keystr); + data = dbwrap_fetch_bystring(autorid_db, talloc_tos(), keystr); + TALLOC_FREE(keystr); if (!data.dptr) { DEBUG(4, ("id %d belongs to range %d which does not have " @@ -172,6 +172,7 @@ static NTSTATUS idmap_autorid_id_to_sid(TALLOC_CTX * memctx, } string_to_sid(&sid, (const char *)data.dptr); + TALLOC_FREE(data.dptr); sid_compose(map->sid, &sid, (map->xid.id - cfg->minvalue - @@ -244,7 +245,7 @@ static NTSTATUS idmap_autorid_unixids_to_sids(struct idmap_domain *dom, for (i = 0; ids[i]; i++) { - ret = idmap_autorid_id_to_sid(ctx, globalcfg, ids[i]); + ret = idmap_autorid_id_to_sid(globalcfg, ids[i]); if ((!NT_STATUS_IS_OK(ret)) && (!NT_STATUS_EQUAL(ret, NT_STATUS_NONE_MAPPED))) { |