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

View file

@ -103,8 +103,11 @@ 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 );
dst[dst_len] = 0;
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;
}