balloc: Fix memory leak when get_block() fails.

This commit is contained in:
Jilles Tjoelker 2014-02-23 22:14:47 +01:00
parent e3a3eb92a4
commit 899b05d387

View file

@ -240,6 +240,7 @@ newblock(rb_bh *bh)
b->elems = get_block(b->alloc_size); b->elems = get_block(b->alloc_size);
if(rb_unlikely(b->elems == NULL)) if(rb_unlikely(b->elems == NULL))
{ {
rb_free(b);
return (1); return (1);
} }
offset = (uintptr_t)b->elems; offset = (uintptr_t)b->elems;