diff --git a/src/test.c b/src/test.c index 66240a1..2f2b03e 100644 --- a/src/test.c +++ b/src/test.c @@ -979,7 +979,9 @@ int main(int argc, char **argv) { { FILE *fd = fopen("/usr/bin/xdg-mime", "rb"); int_fast8_t is_xdg_mime_exists = fd ? 1 : 0; - fclose(fd); + if (fd) { + fclose(fd); + } if (is_xdg_mime_exists) { CHECK_TRUE(c_simple_http_is_xdg_mime_available());