src/server/daemon/httprequest.c

changeset 665
b8d5b797d090
parent 662
70fdf948b642
--- a/src/server/daemon/httprequest.c	Fri Feb 06 15:57:37 2026 +0100
+++ b/src/server/daemon/httprequest.c	Fri Feb 06 17:07:58 2026 +0100
@@ -487,10 +487,13 @@
     return array;
 }
 
-void header_array_add(HeaderArray *hd, cxmutstr name, cxmutstr value) {
+int header_array_add(HeaderArray *hd, cxmutstr name, cxmutstr value) {
     while(hd->len >= hd->alloc) {
         if(hd->next == NULL) {
             HeaderArray *block = header_array_create();
+            if(!block) {
+                return 1;
+            }
             hd->next = block;
         }
         hd = hd->next;
@@ -498,9 +501,13 @@
     hd->headers[hd->len].name = name;
     hd->headers[hd->len].value = value;
     hd->len++;
+    return 0;
 }
 
 void header_array_free(HeaderArray *hd) {
+    if(!hd) {
+        return;
+    }
     HeaderArray *next;
     while(hd) {
         next = hd->next;

mercurial