qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 06/27] vhost-user-scsi: use g_strdup()


From: Marc-André Lureau
Subject: [Qemu-devel] [PULL 06/27] vhost-user-scsi: use g_strdup()
Date: Tue, 10 Oct 2017 19:11:01 +0200

Since vhost-user-scsi uses glib.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
---
 contrib/vhost-user-scsi/vhost-user-scsi.c | 12 ++++--------
 1 file 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;
 
-- 
2.15.0.rc0.40.gaefcc5f6f




reply via email to

[Prev in Thread] Current Thread [Next in Thread]