mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 18:07:21 +00:00
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.
This commit is contained in:
parent
1ab1c97087
commit
a2fdae65a1
|
@ -3982,6 +3982,7 @@ static enum fill_status fill_sid( struct table *table, const struct expr *cond )
|
||||||
const WCHAR *str;
|
const WCHAR *str;
|
||||||
struct record_sid *rec;
|
struct record_sid *rec;
|
||||||
UINT len;
|
UINT len;
|
||||||
|
NTSTATUS status;
|
||||||
|
|
||||||
if (!(str = find_sid_str( cond ))) return FILL_STATUS_FAILED;
|
if (!(str = find_sid_str( cond ))) return FILL_STATUS_FAILED;
|
||||||
if (!resize_table( table, 1, sizeof(*rec) )) 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 );
|
LocalFree( sid );
|
||||||
return FILL_STATUS_FAILED;
|
return FILL_STATUS_FAILED;
|
||||||
}
|
}
|
||||||
if (LsaLookupSids( handle, 1, &sid, &domain, &name ))
|
if ((status = LsaLookupSids( handle, 1, &sid, &domain, &name )))
|
||||||
{
|
{
|
||||||
LocalFree( sid );
|
LocalFree( sid );
|
||||||
LsaClose( handle );
|
LsaClose( handle );
|
||||||
|
if (status == STATUS_NONE_MAPPED || status == STATUS_SOME_NOT_MAPPED)
|
||||||
|
LsaFreeMemory( domain );
|
||||||
return FILL_STATUS_FAILED;
|
return FILL_STATUS_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue