advpack: Fix possible NULL pointer access in heap_strdupWtoA.

This commit is contained in:
André Hentschel 2012-11-17 22:49:49 +01:00 committed by Alexandre Julliard
parent ac90476211
commit bafe54e7e5
1 changed files with 2 additions and 1 deletions

View File

@ -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;