From 5006dcff4e15b7f840093e0c6c4e6f46a4088120 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 8 Mar 2011 21:55:58 +0100 Subject: idmap-autorid: Slightly simplify idmap_autorid_get_domainrange Signed-off-by: Christian Ambach --- source3/winbindd/idmap_autorid.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'source3/winbindd') diff --git a/source3/winbindd/idmap_autorid.c b/source3/winbindd/idmap_autorid.c index 434de25171..b162b62355 100644 --- a/source3/winbindd/idmap_autorid.c +++ b/source3/winbindd/idmap_autorid.c @@ -54,15 +54,12 @@ static NTSTATUS idmap_autorid_get_domainrange(struct db_context *db, { NTSTATUS ret; uint32_t domainnum, hwm; - char *sidstr, *numstr; + fstring sidstr; + char *numstr; struct autorid_domain_config *cfg; cfg = (struct autorid_domain_config *)private_data; - sidstr = dom_sid_string(talloc_tos(), &(cfg->sid)); - - if (!sidstr) { - return NT_STATUS_NO_MEMORY; - } + dom_sid_string_buf(&(cfg->sid), sidstr, sizeof(sidstr)); if (!dbwrap_fetch_uint32(db, sidstr, &domainnum)) { DEBUG(10, ("Acquiring new range for domain %s\n", sidstr)); @@ -120,11 +117,9 @@ static NTSTATUS idmap_autorid_get_domainrange(struct db_context *db, DEBUG(10, ("Using range #%d for domain %s\n", domainnum, sidstr)); cfg->domainnum = domainnum; - talloc_free(sidstr); return NT_STATUS_OK; error: - talloc_free(sidstr); return ret; } -- cgit