From 76ec53dfb0e046e9aa17490705a99585e561f5b0 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Sun, 3 Nov 2024 17:55:09 +0900 Subject: [PATCH] Fix free'd buf not being set to NULL --- src/static.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/static.c b/src/static.c index 2414fba..429dd8e 100644 --- a/src/static.c +++ b/src/static.c @@ -199,6 +199,7 @@ C_SIMPLE_HTTP_StaticFileInfo c_simple_http_get_file( if (size_t_ret != file_info.buf_size) { fprintf(stderr, "ERROR Failed to read path fd \"%s\"!\n", path); free(file_info.buf); + file_info.buf = NULL; file_info.buf_size = 0; file_info.result = STATIC_FILE_RESULT_FileError; return file_info;