diff options
| author | 2015-09-24 12:03:58 +0000 | |
|---|---|---|
| committer | 2015-09-24 12:03:58 +0000 | |
| commit | b6ec4ef1979db91079bd483236ef878e8bee5a69 (patch) | |
| tree | 0ccde91dafdac70d1400548116e4201348cea8cf | |
| parent | A couple of missing letoh32() conversions of GPT header fields in (diff) | |
| download | wireguard-openbsd-b6ec4ef1979db91079bd483236ef878e8bee5a69.tar.xz wireguard-openbsd-b6ec4ef1979db91079bd483236ef878e8bee5a69.zip | |
Do not leak log file descriptor.
| -rw-r--r-- | usr.bin/tmux/log.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/tmux/log.c b/usr.bin/tmux/log.c index 51eec207250..2428481a138 100644 --- a/usr.bin/tmux/log.c +++ b/usr.bin/tmux/log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.16 2015/09/14 12:12:24 nicm Exp $ */ +/* $OpenBSD: log.c,v 1.17 2015/09/24 12:03:58 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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; |
