Skip to content

Commit

Permalink
vhost-user-scsi: use g_strdup()
Browse files Browse the repository at this point in the history
Since vhost-user-scsi uses glib.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
  • Loading branch information
elmarco committed Oct 10, 2017
1 parent 19409df commit b085b05
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions contrib/vhost-user-scsi/vhost-user-scsi.c
Expand Up @@ -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;
Expand Down Expand Up @@ -854,12 +854,8 @@ int main(int argc, char **argv)
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;

Expand Down

0 comments on commit b085b05

Please sign in to comment.