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

[Xen-changelog] [xen-unstable] libxl: config parser: do not segfault in some error paths



# HG changeset patch
# User Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
# Date 1294774102 0
# Node ID b80c530dac8ce3d1256ded2e2d9effb879c41d45
# Parent  9ee86e8cfd786aa2c71c8cc9d970712cdefdb161
libxl: config parser: do not segfault in some error paths

In error paths, xlu__cfg_set_free can be called on NULL.
So check for that rather than segfaulting.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 tools/libxl/libxlu_cfg.c |    1 +
 1 files changed, 1 insertion(+)

diff -r 9ee86e8cfd78 -r b80c530dac8c tools/libxl/libxlu_cfg.c
--- a/tools/libxl/libxlu_cfg.c  Tue Jan 11 15:10:21 2011 +0000
+++ b/tools/libxl/libxlu_cfg.c  Tue Jan 11 19:28:22 2011 +0000
@@ -93,6 +93,7 @@ void xlu__cfg_set_free(XLU_ConfigSetting
 void xlu__cfg_set_free(XLU_ConfigSetting *set) {
     int i;
 
+    if (!set) return;
     free(set->name);
     for (i=0; i<set->nvalues; i++)
         free(set->values[i]);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.