summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libcli/security/security_token.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libcli/security/security_token.c b/libcli/security/security_token.c
index 95a09b3378..6812d42ba0 100644
--- a/libcli/security/security_token.c
+++ b/libcli/security/security_token.c
@@ -119,12 +119,14 @@ bool security_token_has_sid(const struct security_token *token, const struct dom
bool security_token_has_sid_string(const struct security_token *token, const char *sid_string)
{
bool ret;
- struct dom_sid *sid = dom_sid_parse_talloc(NULL, sid_string);
- if (!sid) return false;
+ struct dom_sid sid;
- ret = security_token_has_sid(token, sid);
+ ret = dom_sid_parse(sid_string, &sid);
+ if (!ret) {
+ return false;
+ }
- talloc_free(sid);
+ ret = security_token_has_sid(token, &sid);
return ret;
}