Fixed memory leak when running Tesseract