From 742a047a40e6eeb32aea9ededf6bd294d5263ff8 Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Thu, 29 Aug 2013 16:22:59 -0500 Subject: [PATCH] Fix malloc/delete mismatch. --- src/input/Manager.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/input/Manager.cc b/src/input/Manager.cc index 9e8e406346..2534ed1b69 100644 --- a/src/input/Manager.cc +++ b/src/input/Manager.cc @@ -2090,9 +2090,7 @@ HashKey* Manager::HashValues(const int num_elements, const Value* const *vals) return NULL; int position = 0; - char *data = (char*) malloc(length); - if ( data == 0 ) - reporter->InternalError("Could not malloc?"); + char *data = new char[length]; for ( int i = 0; i < num_elements; i++ ) { @@ -2108,7 +2106,7 @@ HashKey* Manager::HashValues(const int num_elements, const Value* const *vals) } HashKey *key = new HashKey(data, length); - delete data; + delete [] data; assert(position == length); return key;