Commit a2fdae65 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

wbemprox: Fix a memory leak (Coverity).

When LsaLookupSids() fails with STATUS_NONE_MAPPED or STATUS_SOME_NOT_MAPPED, the memory returned by the domain parameter should be freed.
parent 1ab1c970
......@@ -3982,6 +3982,7 @@ static enum fill_status fill_sid( struct table *table, const struct expr *cond )
const WCHAR *str;
struct record_sid *rec;
UINT len;
NTSTATUS status;
if (!(str = find_sid_str( cond ))) return FILL_STATUS_FAILED;
if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
......@@ -3996,10 +3997,12 @@ static enum fill_status fill_sid( struct table *table, const struct expr *cond )
LocalFree( sid );
return FILL_STATUS_FAILED;
}
if (LsaLookupSids( handle, 1, &sid, &domain, &name ))
if ((status = LsaLookupSids( handle, 1, &sid, &domain, &name )))
{
LocalFree( sid );
LsaClose( handle );
if (status == STATUS_NONE_MAPPED || status == STATUS_SOME_NOT_MAPPED)
LsaFreeMemory( domain );
return FILL_STATUS_FAILED;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment