Commit 774ce035 authored by Rusty Russell's avatar Rusty Russell

alloc: fix bug in tiny allocator.

parent d60ebe67
......@@ -186,7 +186,7 @@ void *tiny_alloc_get(void *pool, unsigned long poolsize,
if (long_enough(off, len, size, align)) {
/* Move every successive entry down. */
memmove(arr + fa_off, arr + fa_off + fa_hdrlen,
freelen - fa_hdrlen);
freelen - (fa_off + fa_hdrlen));
memset(arr + freelen - fa_hdrlen, 0, fa_hdrlen);
goto found;
}
......
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