From 218b6d80604d8c26f50334ff2ec1166770bcea4e Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Mon, 12 May 2014 00:05:15 +0200 Subject: [PATCH] test_cls_rbd.cc: use 'delete []' if 'new char[len]' was used Fix for: [src/test/cls_rbd/test_cls_rbd.cc:82]: (error) Mismatching allocation and deallocation: b [src/test/cls_rbd/test_cls_rbd.cc:95]: (error) Mismatching allocation and deallocation: b [src/test/cls_rbd/test_cls_rbd.cc:97]: (error) Mismatching allocation and deallocation: b Signed-off-by: Danny Al-Gaaf --- src/test/cls_rbd/test_cls_rbd.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/cls_rbd/test_cls_rbd.cc b/src/test/cls_rbd/test_cls_rbd.cc index 48cfb33a9e1..29e8c632751 100644 --- a/src/test/cls_rbd/test_cls_rbd.cc +++ b/src/test/cls_rbd/test_cls_rbd.cc @@ -79,7 +79,7 @@ TEST(cls_rbd, copyup) size_t l = 4 << 20; char *b = random_buf(l); inbl.append(b, l); - delete b; + delete [] b; ASSERT_EQ(l, inbl.length()); // copyup to nonexistent object should create new object @@ -94,7 +94,7 @@ TEST(cls_rbd, copyup) bufferlist inbl2; b = random_buf(l); inbl2.append(b, l); - delete b; + delete [] b; ASSERT_EQ(l, inbl2.length()); // should still succeed -- 2.47.3