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

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