mirror of
git://source.winehq.org/git/wine.git
synced 2024-07-20 23:34:10 +00:00
regedit: Fixed a memory leak in listview.c (found by Smatch).
This commit is contained in:
parent
cd6472f794
commit
4278c670d1
|
@ -61,7 +61,10 @@ static LPTSTR get_item_text(HWND hwndLV, int item)
|
||||||
|
|
||||||
curStr = HeapAlloc(GetProcessHeap(), 0, maxLen);
|
curStr = HeapAlloc(GetProcessHeap(), 0, maxLen);
|
||||||
if (!curStr) return NULL;
|
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 {
|
do {
|
||||||
ListView_GetItemText(hwndLV, item, 0, curStr, maxLen);
|
ListView_GetItemText(hwndLV, item, 0, curStr, maxLen);
|
||||||
if (_tcslen(curStr) < maxLen - 1) return curStr;
|
if (_tcslen(curStr) < maxLen - 1) return curStr;
|
||||||
|
|
Loading…
Reference in a new issue