From f52690dc68e2b2778f7c85eae64b3dc45f06409a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 26 May 2014 20:48:05 +0000 Subject: libcli: Fix a memleak struct security_ace has a struct dom_sid, not a pointer to it. So we don't have to talloc it first and then not free it. Signed-off-by: Volker Lendecke Reviewed-by: Andreas Schneider Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Tue May 27 12:54:55 CEST 2014 on sn-devel-104 --- libcli/security/security_descriptor.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'libcli/security') diff --git a/libcli/security/security_descriptor.c b/libcli/security/security_descriptor.c index 574dd4e317..25b316cdd2 100644 --- a/libcli/security/security_descriptor.c +++ b/libcli/security/security_descriptor.c @@ -564,21 +564,19 @@ struct security_ace *security_ace_create(TALLOC_CTX *mem_ctx, uint8_t flags) { - struct dom_sid *sid; struct security_ace *ace; + bool ok; ace = talloc_zero(mem_ctx, struct security_ace); if (ace == NULL) { return NULL; } - sid = dom_sid_parse_talloc(ace, sid_str); - if (sid == NULL) { + ok = dom_sid_parse(sid_str, &ace->trustee); + if (!ok) { talloc_free(ace); return NULL; } - - ace->trustee = *sid; ace->type = type; ace->access_mask = access_mask; ace->flags = flags; -- cgit