From 8cdb3ba9256bf61453c25ee728349cd18dabe236 Mon Sep 17 00:00:00 2001 From: Soikk Date: Wed, 10 Dec 2025 19:55:12 +0100 Subject: Removed naked allocations for strings --- src/net/net.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/net') diff --git a/src/net/net.c b/src/net/net.c index ce1c815..39b25e3 100755 --- a/src/net/net.c +++ b/src/net/net.c @@ -397,8 +397,7 @@ static uint64_t http_len(struct http_message *hm){ }*/ static str http_header_to_str(struct http_message *hm){ - str s = {0}; - s.ptr = calloc(http_len(hm) + 1, sizeof(char)); + str s = dnstr(http_len(hm)); copy_strs(s, hm->method, sstr(" "), hm->url, sstr(" "), hm->req_ver, sstr("\r\n")); for(int i = 0; i < hm->hlen; i++){ copy_strs(s, hm->headers[i].name, sstr(": "), hm->headers[i].value, sstr("\r\n")); -- cgit v1.2.3