advpack: Fix possible NULL pointer access in heap_strdupWtoA.
This commit is contained in:
parent
ac90476211
commit
bafe54e7e5
|
@ -44,7 +44,8 @@ static inline char *heap_strdupWtoA(const WCHAR *str)
|
||||||
if(str) {
|
if(str) {
|
||||||
size_t size = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
|
size_t size = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
|
||||||
ret = heap_alloc(size);
|
ret = heap_alloc(size);
|
||||||
WideCharToMultiByte(CP_ACP, 0, str, -1, ret, size, NULL, NULL);
|
if(ret)
|
||||||
|
WideCharToMultiByte(CP_ACP, 0, str, -1, ret, size, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue