slab: free slab page if page desc alloc failed
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
This commit is contained in:
committed by
Avi Kivity
parent
6692435757
commit
087a34a544
@@ -222,7 +222,7 @@ public:
|
||||
auto objects = max_object_size / _size;
|
||||
desc = new slab_page_desc(slab_page, objects, _size, _slab_class_id, slab_page_index);
|
||||
} catch (const std::bad_alloc& e) {
|
||||
// FIXME: Is there really a need to re-throw std::bad_alloc?
|
||||
::free(slab_page);
|
||||
throw std::bad_alloc{};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user