net: remove dead and redundant code

server cannot be NULL at this point (we return error earlier if it is).
Also structure is zalloc'ed, so no need to explicitly initialize
members to 0.

Found by: Coverity scan.
CID: 73837
This commit is contained in:
Andrei Borzenkov 2016-01-10 11:33:13 +03:00
parent 269a522c7d
commit 528256932b

View file

@ -1322,20 +1322,13 @@ grub_net_open_real (const char *name)
if (!ret)
return NULL;
ret->protocol = proto;
if (server)
ret->server = grub_strdup (server);
if (!ret->server)
{
ret->server = grub_strdup (server);
if (!ret->server)
{
grub_free (ret);
return NULL;
}
grub_free (ret);
return NULL;
}
else
ret->server = NULL;
ret->fs = &grub_net_fs;
ret->offset = 0;
ret->eof = 0;
return ret;
}
}