Commit 0dda8a14 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

jsproxy: Avoid potential NULL dereference (Coverity).

parent 7b8aa860
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment