summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2017-08-16 20:21:13 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2017-10-10 23:31:08 +0200
commitb085b050c6a6ad5160ffc371b97e2113b7de9f66 (patch)
treefdc60558ceed56d86b6d920ab1c80d1e5f9d90df /contrib
parent19409df8835674ca9b3c30517b032abb5eca01e6 (diff)
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>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/vhost-user-scsi/vhost-user-scsi.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/contrib/vhost-user-scsi/vhost-user-scsi.c b/contrib/vhost-user-scsi/vhost-user-scsi.c
index 78bcc65f5a..1fb57da2da 100644
--- a/contrib/vhost-user-scsi/vhost-user-scsi.c
+++ b/contrib/vhost-user-scsi/vhost-user-scsi.c
@@ -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;