summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-01-28 18:56:12 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-01-28 18:56:12 -0500
commitac3563dce6c0cceef83f4e838365178da4602507 (patch)
tree06001d8ca1163369e2b8c2428065baa1d5d0de6c
parent3478fbd89a51072bca971b168c3c947e016b6272 (diff)
make sure log exists before closing it
-rw-r--r--main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main.c b/main.c
index 49e9a00..176f972 100644
--- a/main.c
+++ b/main.c
@@ -542,7 +542,7 @@ int main(int argc, char **argv) {
if (ted->menu)
menu_close(ted, false); // free any memory used by the current menu
- fclose(log);
+ if (log) fclose(log);
SDL_GL_DeleteContext(glctx);
SDL_DestroyWindow(window);