http: Fix segmentation vault in http_free_hdr when fields is NULL

This commit is contained in:
2026-06-01 12:05:08 +02:00
parent ff8a72bf30
commit 42b5b94004
+1
View File
@@ -101,6 +101,7 @@ void http_free_field(http_field *f) {
} }
void http_free_hdr(http_hdr *hdr) { void http_free_hdr(http_hdr *hdr) {
if (hdr->fields == NULL) return;
for (int i = 0; i < list_size(hdr->fields); i++) { for (int i = 0; i < list_size(hdr->fields); i++) {
http_free_field(&hdr->fields[i]); http_free_field(&hdr->fields[i]);
} }