mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03: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
|
@ -18,9 +18,7 @@ void blkconf_serial(BlockConf *conf, char **serial)
|
|||
if (!*serial) {
|
||||
/* try to fall back to value set with legacy -drive serial=... */
|
||||
dinfo = drive_get_by_blockdev(conf->bs);
|
||||
if (dinfo->serial) {
|
||||
*serial = g_strdup(dinfo->serial);
|
||||
}
|
||||
*serial = g_strdup(dinfo->serial);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue