diff options
author | nicm <nicm> | 2015-09-24 12:03:58 +0000 |
---|---|---|
committer | nicm <nicm> | 2015-09-24 12:03:58 +0000 |
commit | 69ea6b9373c0cc992932499b89330c26e27d6510 (patch) | |
tree | e7d44f29676a63fc0e323821fd2a2370e4023bc4 /log.c | |
parent | ddb2d1221b3a824114e7c456251c4cf983b0b330 (diff) |
Do not leak log file descriptor.
Diffstat (limited to 'log.c')
-rw-r--r-- | log.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -42,6 +42,9 @@ log_event_cb(unused int severity, const char *msg) void log_open(const char *path) { + if (log_file != NULL) + fclose(log_file); + log_file = fopen(path, "w"); if (log_file == NULL) return; |