From b07c6d71a4047cafc182652f48a664936acc8783 Mon Sep 17 00:00:00 2001 From: berak <px1704@web.de> Date: Wed, 4 Mar 2015 10:12:15 +0100 Subject: [PATCH] fix missing delete[] calls in or_mnist.cpp --- modules/datasets/src/or_mnist.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/datasets/src/or_mnist.cpp b/modules/datasets/src/or_mnist.cpp index e85266c1e..1e206f306 100644 --- a/modules/datasets/src/or_mnist.cpp +++ b/modules/datasets/src/or_mnist.cpp @@ -84,6 +84,7 @@ void OR_mnistImp::loadDatasetPart(const string &imagesFile, const string &labels fclose(f); if (num*imageSize != res) { + delete[] images; return; } f = fopen(labelsFile.c_str(), "rb"); @@ -93,6 +94,8 @@ void OR_mnistImp::loadDatasetPart(const string &imagesFile, const string &labels fclose(f); if (num != res) { + delete[] images; + delete[] labels; return; }