net: Fix crash on http

Don't free file->data on receiving FIN flag since it is used all over
without checking. http_close() will be called later to free that memory.

Fixes bug: https://bugzilla.redhat.com/show_bug.cgi?id=860834

Signed-off-by: Gustavo Luiz Duarte <gustavold@linux.vnet.ibm.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Gustavo Luiz Duarte 2019-09-17 17:44:58 +02:00 committed by Daniel Kiper
parent 3ea9bc3c06
commit fc085f7f18

View file

@ -392,7 +392,7 @@ http_establish (struct grub_file *file, grub_off_t offset, int initial)
data->sock = grub_net_tcp_open (file->device->net->server,
HTTP_PORT, http_receive,
http_err, http_err,
http_err, NULL,
file);
if (!data->sock)
{