Don't store new headers unless ones weren't available
This commit is contained in:
parent
529b86dade
commit
93ff826f67
|
@ -60,7 +60,10 @@ static struct line_read_result read_line(const char *buffer, int buffer_size, st
|
|||
// Must start copying after the :
|
||||
memcpy(header_value, (buffer + name_size + 1), value_size);
|
||||
header_value[value_size] = '\0';
|
||||
message->headers = insert_header(header_name, header_value, message->headers);
|
||||
struct http_header *new_header = insert_header(header_name, header_value, message->headers);
|
||||
if (message->headers == NULL) {
|
||||
message->headers = new_header;
|
||||
}
|
||||
free(header_value);
|
||||
free(header_name);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue