Commit 4278c670 authored by Lionel Debroux's avatar Lionel Debroux Committed by Alexandre Julliard

regedit: Fixed a memory leak in listview.c (found by Smatch).

parent cd6472f7
......@@ -61,7 +61,10 @@ static LPTSTR get_item_text(HWND hwndLV, int item)
curStr = HeapAlloc(GetProcessHeap(), 0, maxLen);
if (!curStr) return NULL;
if (item == 0) return NULL; /* first item is ALWAYS a default */
if (item == 0) { /* first item is ALWAYS a default */
HeapFree(GetProcessHeap(), 0, curStr);
return NULL;
}
do {
ListView_GetItemText(hwndLV, item, 0, curStr, maxLen);
if (_tcslen(curStr) < maxLen - 1) return curStr;
......
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