Merge pull request #21 from kenny1847/patch-1

Resolve ImageReaderSource memory leak
This commit is contained in:
Benjamin Dobell 2015-07-13 14:02:58 +10:00
commit 411ca6c2d6

View File

@ -75,6 +75,7 @@ Ref<LuminanceSource> ImageReaderSource::create(string const& filename) {
char *buffer = reinterpret_cast<char*>(jpgd::decompress_jpeg_image_from_file(
filename.c_str(), &width, &height, &comps, 4));
image = zxing::ArrayRef<char>(buffer, 4 * width * height);
free(buffer);
}
if (!image) {
ostringstream msg;