Commit 622a2404 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/listview: Return earlier on allocation failure (Coverity).

parent 42cc080f
......@@ -5863,13 +5863,15 @@ static BOOL LISTVIEW_EndEditLabelT(LISTVIEW_INFO *infoPtr, BOOL storeText, BOOL
{
DWORD len = isW ? GetWindowTextLengthW(infoPtr->hwndEdit) : GetWindowTextLengthA(infoPtr->hwndEdit);
if (len)
if (len++)
{
if ((pszText = Alloc((len+1) * (isW ? sizeof(WCHAR) : sizeof(CHAR)))))
{
if (isW) GetWindowTextW(infoPtr->hwndEdit, pszText, len+1);
else GetWindowTextA(infoPtr->hwndEdit, (CHAR*)pszText, len+1);
}
if (!(pszText = Alloc(len * (isW ? sizeof(WCHAR) : sizeof(CHAR)))))
return FALSE;
if (isW)
GetWindowTextW(infoPtr->hwndEdit, pszText, len);
else
GetWindowTextA(infoPtr->hwndEdit, (CHAR*)pszText, len);
}
}
......
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