vhost-user-scsi: use g_strdup()

Since vhost-user-scsi uses glib.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
This commit is contained in:
Marc-André Lureau 2017-08-16 20:21:13 +02:00
parent 19409df883
commit b085b050c6
1 changed files with 4 additions and 8 deletions

View File

@ -822,10 +822,10 @@ int main(int argc, char **argv)
case 'h':
goto help;
case 'u':
unix_fn = strdup(optarg);
unix_fn = g_strdup(optarg);
break;
case 'i':
iscsi_uri = strdup(optarg);
iscsi_uri = g_strdup(optarg);
break;
default:
goto help;
@ -854,12 +854,8 @@ out:
vdev_scsi_deinit(vdev_scsi);
free(vdev_scsi);
}
if (unix_fn) {
free(unix_fn);
}
if (iscsi_uri) {
free(iscsi_uri);
}
g_free(unix_fn);
g_free(iscsi_uri);
return err;