Skip to content

Commit

Permalink
Fix minor memory leak in HDF5 utility functions
Browse files Browse the repository at this point in the history
  • Loading branch information
erictzeng committed Jul 30, 2015
1 parent c31fb4f commit 5511688
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/caffe/util/hdf5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ void hdf5_save_nd_dataset<float>(
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 <>
Expand All @@ -92,6 +93,7 @@ void hdf5_save_nd_dataset<double>(
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) {
Expand Down

0 comments on commit 5511688

Please sign in to comment.