diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2008-05-25 13:07:53 +0000 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2008-05-25 13:07:53 +0000 |
commit | 024918c239095d1768553055abb2ee2de12dc8fc (patch) | |
tree | 86fa1c834185fa34a68db85d6fabbd4d81c7e165 | |
parent | e19c7341563cc31a9a3b28255d32e03c5b7fc5a1 (diff) | |
download | suspend-utils-024918c239095d1768553055abb2ee2de12dc8fc.tar.gz |
Fix a bug in the new memory allocator that may trigger on an attempt to
pass a wrong address to freemem() and cause it to enter an endless loop.
-rw-r--r-- | memalloc.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -167,8 +167,9 @@ void freemem(void *address) } else if (address > slots[k].addr) { if (i != k) { i = k; - } else if (slots[j].addr == address) { - free_slot(j); + } else { + if (slots[j].addr == address) + free_slot(j); break; } } else { |