[MOAB-dev] commit/MOAB: danwu: Use delete[] to free the memory allocated by read_variable_to_set_allocate().

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon Nov 25 12:33:34 CST 2013


1 new commit in MOAB:

https://bitbucket.org/fathomteam/moab/commits/4cdfdf8163b7/
Changeset:   4cdfdf8163b7
Branch:      master
User:        danwu
Date:        2013-11-25 19:33:24
Summary:     Use delete[] to free the memory allocated by read_variable_to_set_allocate().

Affected #:  1 file

diff --git a/src/io/NCHelper.cpp b/src/io/NCHelper.cpp
index 44fcdc3..89245a4 100644
--- a/src/io/NCHelper.cpp
+++ b/src/io/NCHelper.cpp
@@ -443,19 +443,19 @@ ErrorCode NCHelper::read_variable_to_set(std::vector<ReadNC::VarData>& vdatas, s
       switch (vdatas[i].varDataType) {
         case NC_BYTE:
         case NC_CHAR:
-          delete (char*) data;
+          delete[] (char*) data;
           break;
         case NC_DOUBLE:
-          delete (double*) data;
+          delete[] (double*) data;
           break;
         case NC_FLOAT:
-          delete (float*) data;
+          delete[] (float*) data;
           break;
         case NC_INT:
-          delete (int*) data;
+          delete[] (int*) data;
           break;
         case NC_SHORT:
-          delete (short*) data;
+          delete[] (short*) data;
           break;
         default:
           break;

Repository URL: https://bitbucket.org/fathomteam/moab/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.


More information about the moab-dev mailing list