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

2010-01-06 Thread Jim Fehlig
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 jfeh...@novell.com
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@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

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

2010-01-06 Thread Matthias Bolte
2010/1/7 Jim Fehlig jfeh...@novell.com:
 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


I posted the same patch 3 days ago and DV ACKed it today. Haven't
pushed it yet, but I'll do so now.

Matthias

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

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

2010-01-06 Thread Jim Fehlig
Matthias Bolte wrote:
 2010/1/7 Jim Fehlig jfeh...@novell.com:
   
 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

 

 I posted the same patch 3 days ago and DV ACKed it today. Haven't
 pushed it yet, but I'll do so now.
   

Oh, I missed it - sorry.  Thanks for pushing!

Regards,
Jim

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