dropbox / lepton

Lepton is a tool and file format for losslessly compressing JPEGs by an average of 22%.
https://blogs.dropbox.com/tech/2016/07/lepton-image-compression-saving-22-losslessly-from-images-at-15mbs/
Apache License 2.0
5.01k stars 355 forks source link

resource leak: fp #65

Closed bryonglodencissp closed 8 years ago

bryonglodencissp commented 8 years ago

With reference to (WRT) @AlexanderFrolov and https://github.com/dropbox/lepton/pull/62, calling fclose(fp) here will ensure the file descriptor is properly disposed of and output buffers flushed so the data written to the file will be present in the file on disk. Furthermore, calling fclose(fp) with not cause a segmentation in some OS because fp != NULL.