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:
Markus Armbruster 2013-01-22 11:07:57 +01:00 committed by Stefan Hajnoczi
parent 6528499fa4
commit c64f50d1e2
5 changed files with 7 additions and 23 deletions

View file

@ -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);
}