mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-29 05:13:54 -06:00
g_strdup(NULL) returns NULL; simplify
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
6528499fa4
commit
c64f50d1e2
5 changed files with 7 additions and 23 deletions
|
@ -566,9 +566,7 @@ static int net_init_nic(const NetClientOptions *opts, const char *name,
|
|||
assert(peer);
|
||||
nd->netdev = peer;
|
||||
}
|
||||
if (name) {
|
||||
nd->name = g_strdup(name);
|
||||
}
|
||||
nd->name = g_strdup(name);
|
||||
if (nic->has_model) {
|
||||
nd->model = g_strdup(nic->model);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue