fix memory leaks and unecessary newlines in logs

This commit is contained in:
Nayan
2025-05-08 22:51:56 -04:00
parent 63a016cf36
commit 613e87ad86
4 changed files with 10 additions and 4 deletions

View File

@@ -216,6 +216,7 @@ char* response_headers_to_string(http_response* res) {
strcat(response, "Content-Length: ");
strcat(response, content_lenth_str);
strcat(response, "\r\n\r\n");
free(content_lenth_str);
return response;
}
@@ -226,7 +227,7 @@ char* get_header_value_request(http_request* req, char* key) {
return req->headers[i].value;
}
}
log_message(LOG_WARN, "Header %s not found\n", key);
log_message(LOG_WARN, "Header %s not found", key);
return NULL;
}