balloc: Fix memory leak when get_block() fails.
This commit is contained in:
parent
e3a3eb92a4
commit
899b05d387
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue