From: Alexandru Ardelean Date: Mon, 10 Jul 2017 15:00:41 +0000 (+0300) Subject: tests: fix leak in `test_util_file` ; found by cppcheck X-Git-Tag: json-c-0.13-20171207~72^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b9432d5648c902800dea1208143febb9db632cc;p=thirdparty%2Fjson-c.git tests: fix leak in `test_util_file` ; found by cppcheck Which now seems to fail the build. Signed-off-by: Alexandru Ardelean --- diff --git a/tests/test_util_file.c b/tests/test_util_file.c index f98dce2e..5dbdb477 100644 --- a/tests/test_util_file.c +++ b/tests/test_util_file.c @@ -106,6 +106,7 @@ static void stat_and_cat(const char *file) buf[sb.st_size] = '\0'; printf("file[%s], size=%d, contents=%s\n", file, (int)sb.st_size, buf); free(buf); + close(d); } int main(int argc, char **argv)