mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-01 11:33:38 +00:00
wmic: Use CRT allocation functions.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
00291118db
commit
89f10a0f4b
|
@ -61,15 +61,6 @@ static const WCHAR *find_class( const WCHAR *alias )
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline WCHAR *strdupW( const WCHAR *src )
|
|
||||||
{
|
|
||||||
WCHAR *dst;
|
|
||||||
if (!src) return NULL;
|
|
||||||
if (!(dst = HeapAlloc( GetProcessHeap(), 0, (lstrlenW( src ) + 1) * sizeof(WCHAR) ))) return NULL;
|
|
||||||
lstrcpyW( dst, src );
|
|
||||||
return dst;
|
|
||||||
}
|
|
||||||
|
|
||||||
static WCHAR *find_prop( IWbemClassObject *class, const WCHAR *prop )
|
static WCHAR *find_prop( IWbemClassObject *class, const WCHAR *prop )
|
||||||
{
|
{
|
||||||
SAFEARRAY *sa;
|
SAFEARRAY *sa;
|
||||||
|
@ -85,7 +76,7 @@ static WCHAR *find_prop( IWbemClassObject *class, const WCHAR *prop )
|
||||||
SafeArrayGetElement( sa, &i, &str );
|
SafeArrayGetElement( sa, &i, &str );
|
||||||
if (!wcsicmp( str, prop ))
|
if (!wcsicmp( str, prop ))
|
||||||
{
|
{
|
||||||
ret = strdupW( str );
|
ret = wcsdup( str );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -228,7 +219,7 @@ done:
|
||||||
SysFreeString( path );
|
SysFreeString( path );
|
||||||
SysFreeString( query );
|
SysFreeString( query );
|
||||||
SysFreeString( wql );
|
SysFreeString( wql );
|
||||||
HeapFree( GetProcessHeap(), 0, prop );
|
free( prop );
|
||||||
CoUninitialize();
|
CoUninitialize();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue