jsproxy: Avoid potential NULL dereference (Coverity).

This commit is contained in:
Marcus Meissner 2014-05-20 08:47:38 +02:00 committed by Alexandre Julliard
parent 7b8aa8606c
commit 0dda8a14db
1 changed files with 5 additions and 2 deletions

View File

@ -103,9 +103,12 @@ static inline WCHAR *strdupAW( const char *src, DWORD len )
if (src)
{
int dst_len = MultiByteToWideChar( CP_ACP, 0, src, len, NULL, 0 );
if ((dst = heap_alloc( (dst_len + 1) * sizeof(WCHAR) ))) len = MultiByteToWideChar( CP_ACP, 0, src, len, dst, dst_len );
if ((dst = heap_alloc( (dst_len + 1) * sizeof(WCHAR) )))
{
len = MultiByteToWideChar( CP_ACP, 0, src, len, dst, dst_len );
dst[dst_len] = 0;
}
}
return dst;
}