This fix is not correct. It indeed looks like there is currently a fd leak when `file && GetFilesize(file) < 10 * 1000000`, but your change would also cause a fclose in the case that file == NULL (when the debug log cannot be opened; resulting in a segmentation fault).