From b5c10bf059872f0af02efa1d4eb9d7dd8a0f3102 Mon Sep 17 00:00:00 2001 From: Haomai Wang Date: Wed, 12 Feb 2014 12:04:30 +0800 Subject: [PATCH] Fix bad dealloctor Memory allocated by malloc() should be deallocated by free(), not 'delete' Signed-off-by: Haomai Wang --- src/common/buffer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/buffer.cc b/src/common/buffer.cc index eab91433aa9..875d1e15221 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -447,7 +447,7 @@ static uint32_t simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZE if (r < (ssize_t)len) { bdout << "raw_pipe: error reading from temp pipe:" << cpp_strerror(r) << bendl; - delete data; + free(data); data = NULL; close_pipe(tmpfd); throw error_code(r);