diff options
-rw-r--r-- | src/sls.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/sls.cpp b/src/sls.cpp index 0eead68..aa0167f 100644 --- a/src/sls.cpp +++ b/src/sls.cpp @@ -486,12 +486,14 @@ bool SLSManager::encodeFile(const std::string& fname, int fidx, bool raw_slides) blob = (uint8_t*) malloc(blobsize); if (blob == NULL) { fprintf(stderr, "ODR-PadEnc Error: Memory allocation error\n"); + fclose(pFile); goto encodefile_out; } // copy the file into the buffer: if (fread(blob, blobsize, 1, pFile) != 1) { fprintf(stderr, "ODR-PadEnc Error: Could not read file\n"); + fclose(pFile); goto encodefile_out; } |