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.
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, callingfclose(fp)
with not cause a segmentation in some OS becausefp != NULL
.