From: Danny Al-Gaaf Date: Sun, 11 May 2014 22:05:15 +0000 (+0200) Subject: test_cls_rbd.cc: use 'delete []' if 'new char[len]' was used X-Git-Tag: v0.81~27^2~15 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=218b6d80604d8c26f50334ff2ec1166770bcea4e;p=ceph.git 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 --- diff --git a/src/test/cls_rbd/test_cls_rbd.cc b/src/test/cls_rbd/test_cls_rbd.cc index 48cfb33a9e1c..29e8c632751f 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