[libvirt] fix for crash in NPIV code

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

 



DV found a place in the NPIV code that was freeing the wrong thing in the error case causing a segfault. The patch to fix it follows.

Dave


diff --git a/src/node_device.c b/src/node_device.c
index cd9f0ef..c5b839b 100644
--- a/src/node_device.c
+++ b/src/node_device.c
@@ -489,8 +489,8 @@ get_wwns(virConnectPtr conn,

     if (*wwnn == NULL || *wwpn == NULL) {
         /* Free the other one, if allocated... */
-        VIR_FREE(wwnn);
-        VIR_FREE(wwpn);
+        VIR_FREE(*wwnn);
+        VIR_FREE(*wwpn);
         ret = -1;
         virReportOOMError(conn);
     }

--
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]