diff --git a/src/caffe/util/hdf5.cpp b/src/caffe/util/hdf5.cpp index 6429f3821bc..d0d05f70f8f 100644 --- a/src/caffe/util/hdf5.cpp +++ b/src/caffe/util/hdf5.cpp @@ -72,6 +72,7 @@ void hdf5_save_nd_dataset( herr_t status = H5LTmake_dataset_float( file_id, dataset_name.c_str(), num_axes, dims, data); CHECK_GE(status, 0) << "Failed to make float dataset " << dataset_name; + delete[] dims; } template <> @@ -92,6 +93,7 @@ void hdf5_save_nd_dataset( herr_t status = H5LTmake_dataset_double( file_id, dataset_name.c_str(), num_axes, dims, data); CHECK_GE(status, 0) << "Failed to make double dataset " << dataset_name; + delete[] dims; } string hdf5_load_string(hid_t loc_id, const string& dataset_name) {