diff --git a/src/mlpack/core/data/detect_file_type.cpp b/src/mlpack/core/data/detect_file_type.cpp index 1ade1340aa..4344bb5299 100644 --- a/src/mlpack/core/data/detect_file_type.cpp +++ b/src/mlpack/core/data/detect_file_type.cpp @@ -87,7 +87,7 @@ arma::file_type GuessFileType(std::istream& f) if (!loadOkay) { - delete dataMem; + delete[] dataMem; return arma::file_type_unknown; } @@ -114,7 +114,7 @@ arma::file_type GuessFileType(std::istream& f) } } - delete dataMem; + delete[] dataMem; if (hasBinary) return arma::raw_binary;