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': case 'h':
goto help; goto help;
case 'u': case 'u':
unix_fn = strdup(optarg); unix_fn = g_strdup(optarg);
break; break;
case 'i': case 'i':
iscsi_uri = strdup(optarg); iscsi_uri = g_strdup(optarg);
break; break;
default: default:
goto help; goto help;
@ -854,12 +854,8 @@ out:
vdev_scsi_deinit(vdev_scsi); vdev_scsi_deinit(vdev_scsi);
free(vdev_scsi); free(vdev_scsi);
} }
if (unix_fn) { g_free(unix_fn);
free(unix_fn); g_free(iscsi_uri);
}
if (iscsi_uri) {
free(iscsi_uri);
}
return err; return err;