Fix heap delete to mark current as not in use, instead of prev

This commit is contained in:
Gary Talent 2017-10-14 03:19:20 -05:00
parent 70cee81406
commit f6b027c591

View File

@ -75,7 +75,7 @@ void operator delete(void *ptr) {
// ptr was found as a valid memory allocation, deallocate it // ptr was found as a valid memory allocation, deallocate it
if (current) { if (current) {
// mark as not in use // mark as not in use
prev->inUse = false; current->inUse = false;
// join with next if next is also unused // join with next if next is also unused
if (current->next && !current->next->inUse) { if (current->next && !current->next->inUse) {