From 6f114f639adea4bfba801d08f5e2ee206d10d0e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 27 Aug 2020 21:11:03 +0200 Subject: [PATCH] config: close FD if it is *valid*, not when it is *invalid* --- config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.c b/config.c index c1f59b6c..83a0ef4d 100644 --- a/config.c +++ b/config.c @@ -1849,7 +1849,7 @@ out: tll_push_back(conf->fonts, config_font_parse("monospace")); free(conf_file.path); - if (conf_file.fd < 0) + if (conf_file.fd >= 0) close(conf_file.fd); return ret;