Merge pull request #38 from u130b8/fix-realloc

update pGroup after realloc
This commit is contained in:
freedom
2023-10-13 08:21:28 -06:00
committed by GitHub

View File

@@ -266,8 +266,11 @@ PITEM CreateItem(_In_ HWND hWndGroup, _In_ PITEM pi)
if (_msize(pGroup) != CalculateGroupMemory(pGroup, 1))
{
// if we reallocate memory then send the new pointer in
if (realloc(pGroup, CalculateGroupMemory(pGroup, 1)) != NULL)
PGROUP pNewGroup = realloc(pGroup, CalculateGroupMemory(pGroup, 1));
if (pNewGroup != NULL) {
pGroup = pNewGroup;
SetWindowLongPtr(hWndGroup, GWLP_USERDATA, (LONG_PTR)pGroup);
}
}
// add the item