From 087a34a5444897ba2bce7dd084e84409fa5ddef7 Mon Sep 17 00:00:00 2001 From: "Raphael S. Carvalho" Date: Thu, 19 Mar 2015 17:37:04 -0300 Subject: [PATCH] slab: free slab page if page desc alloc failed Signed-off-by: Raphael S. Carvalho --- core/slab.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/slab.hh b/core/slab.hh index e661ef5cfc..91684f69f7 100644 --- a/core/slab.hh +++ b/core/slab.hh @@ -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{}; }