localui: Avoid crash on NULL pointer.
This commit is contained in:
parent
7aa1b2e419
commit
009b8dd519
|
@ -50,11 +50,11 @@ static LPWSTR strdupWW(LPCWSTR pPrefix, LPCWSTR pSuffix)
|
||||||
LPWSTR ptr;
|
LPWSTR ptr;
|
||||||
DWORD len;
|
DWORD len;
|
||||||
|
|
||||||
len = lstrlenW(pPrefix) + lstrlenW(pSuffix) + 1;
|
len = lstrlenW(pPrefix) + (pSuffix ? lstrlenW(pSuffix) : 0) + 1;
|
||||||
ptr = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
|
ptr = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
|
||||||
if (ptr) {
|
if (ptr) {
|
||||||
lstrcpyW(ptr, pPrefix);
|
lstrcpyW(ptr, pPrefix);
|
||||||
lstrcatW(ptr, pSuffix);
|
if (pSuffix) lstrcatW(ptr, pSuffix);
|
||||||
}
|
}
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue