summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util_sid.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c
index f46d363895..fcbbbb44d9 100644
--- a/source3/lib/util_sid.c
+++ b/source3/lib/util_sid.c
@@ -213,11 +213,19 @@ const char *sid_string_static(const DOM_SID *sid)
return sid_str;
}
-char *sid_string_tos(const DOM_SID *sid)
+char *sid_string_talloc(TALLOC_CTX *mem_ctx, const DOM_SID *sid)
{
fstring sid_str;
+ char *result;
sid_to_string(sid_str, sid);
- return talloc_strdup(talloc_tos(), sid_str);
+ result = talloc_strdup(mem_ctx, sid_str);
+ SMB_ASSERT(result != NULL);
+ return result;
+}
+
+char *sid_string_tos(const DOM_SID *sid)
+{
+ return sid_string_talloc(talloc_tos(), sid);
}
/*****************************************************************