mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 16:22:35 +01:00
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);
|
||||
if(rb_unlikely(b->elems == NULL))
|
||||
{
|
||||
rb_free(b);
|
||||
return (1);
|
||||
}
|
||||
offset = (uintptr_t)b->elems;
|
||||
|
|
Loading…
Reference in a new issue