Fix stack freeing error in common

This commit is contained in:
Nick Krichevsky 2018-09-08 17:25:33 -04:00
parent cc014425c4
commit 531a1d6814

View file

@ -247,7 +247,8 @@ enum socket_read_result get_all_remote_parts(int socket_fd, enum socket_type typ
body_result = read_body_by_content_length(socket_fd, net_content_length);
} else if (read_info.strategy == STRATEGY_EOF && type == TYPE_SERVER) {
// Servers cannot just wait for EOF with a client, so we just skip the action.
body_result = "\0";
body_result = malloc(1 * sizeof(char));
*body_result = '\0';
} else {
// In all other cases, such as if we have EOF strategy on a client.
body_result = read_body_until_eof(socket_fd);