From 989ad44d32c2e77972a966d91f1813b0b929f83b Mon Sep 17 00:00:00 2001 From: todd stecher Date: Mon, 19 Jan 2009 15:09:51 -0800 Subject: Memory leaks and other fixes found by Coverity --- source3/utils/net_rpc.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source3/utils/net_rpc.c') diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 652f0b531b..c000b58098 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -4064,7 +4064,11 @@ static bool get_user_sids(const char *domain, const char *user, NT_USER_TOKEN *t return false; } - string_to_sid(&user_sid, sid_str); + if (!string_to_sid(&user_sid, sid_str)) { + DEBUG(1,("Could not convert sid %s from string\n", sid_str)); + return false; + } + wbcFreeMemory(sid_str); sid_str = NULL; @@ -4200,7 +4204,11 @@ static bool get_user_tokens_from_file(FILE *f, /* We have a SID */ DOM_SID sid; - string_to_sid(&sid, &line[1]); + if(!string_to_sid(&sid, &line[1])) { + DEBUG(1,("get_user_tokens_from_file: Could " + "not convert sid %s \n",&line[1])); + return false; + } if (token == NULL) { DEBUG(0, ("File does not begin with username")); -- cgit