[libvirt] [PATCH] Fix free of invalid pointer in node_device_driver

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

 



If device does not have a driver, an uninitialized pointer was being
free()'d in node_device_driver.  Here's a small patch to fix it.

Regards,
Jim
commit 49d8d703e4ac3253155871f97350bec10a15dfaf
Author: Jim Fehlig <jfehlig@xxxxxxxxxx>
Date:   Wed Jan 6 17:17:08 2010 -0700

    Fix free of invalid pointer in node_device_driver
    
    When using HAL, it is possible to free an invalid pointer in
    node_device_driver, e.g. when driver_link does not exist.

diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index ecbac0f..7e2b299 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -78,7 +78,7 @@ static int update_driver_name(virConnectPtr conn,
                               virNodeDeviceObjPtr dev)
 {
     char *driver_link = NULL;
-    char *devpath;
+    char *devpath = NULL;
     char *p;
     int ret = -1;
 
--
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]