Commit f861dc9e authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Merge pull request #182 from berak/fix_mnist

fix missing delete[] calls in or_mnist.cpp
parents 5ec52d47 b07c6d71
...@@ -84,6 +84,7 @@ void OR_mnistImp::loadDatasetPart(const string &imagesFile, const string &labels ...@@ -84,6 +84,7 @@ void OR_mnistImp::loadDatasetPart(const string &imagesFile, const string &labels
fclose(f); fclose(f);
if (num*imageSize != res) if (num*imageSize != res)
{ {
delete[] images;
return; return;
} }
f = fopen(labelsFile.c_str(), "rb"); f = fopen(labelsFile.c_str(), "rb");
...@@ -93,6 +94,8 @@ void OR_mnistImp::loadDatasetPart(const string &imagesFile, const string &labels ...@@ -93,6 +94,8 @@ void OR_mnistImp::loadDatasetPart(const string &imagesFile, const string &labels
fclose(f); fclose(f);
if (num != res) if (num != res)
{ {
delete[] images;
delete[] labels;
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment