diff --git a/dlls/advpack/advpack_private.h b/dlls/advpack/advpack_private.h index a1bcfe44eb0..5d7489778d6 100644 --- a/dlls/advpack/advpack_private.h +++ b/dlls/advpack/advpack_private.h @@ -44,7 +44,8 @@ static inline char *heap_strdupWtoA(const WCHAR *str) if(str) { size_t size = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL); 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;