Fix free'd buf not being set to NULL
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 2m2s

This commit is contained in:
Stephen Seo 2024-11-03 17:55:09 +09:00
parent a14355ac81
commit 76ec53dfb0

View file

@ -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;