[PATCH 06/11] storage_scsi: Don't ignore the return value of VIR_STRDUP

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

 



---
 src/storage/storage_backend_scsi.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/storage/storage_backend_scsi.c b/src/storage/storage_backend_scsi.c
index 0a79e6c..13c498d 100644
--- a/src/storage/storage_backend_scsi.c
+++ b/src/storage/storage_backend_scsi.c
@@ -188,7 +188,12 @@ virStorageBackendSCSISerial(const char *dev)
             *nl = '\0';
     } else {
         VIR_FREE(serial);
-        ignore_value(VIR_STRDUP(serial, dev));
+        if (VIR_STRDUP(serial, dev) < 0)
+#ifdef WITH_UDEV
+            goto cleanup;
+#else
+            return NULL;
+#endif
     }
 
 #ifdef WITH_UDEV
@@ -624,7 +629,8 @@ getAdapterName(virStoragePoolSourceAdapter adapter)
     char *name = NULL;
 
     if (adapter.type != VIR_STORAGE_POOL_SOURCE_ADAPTER_TYPE_FC_HOST) {
-        ignore_value(VIR_STRDUP(name, adapter.data.scsi_host.name));
+        if (VIR_STRDUP(name, adapter.data.scsi_host.name) < 0)
+            return NULL;
         return name;
     }
 
-- 
1.8.1.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]