aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxlu_cfg.c
diff options
context:
space:
mode:
authorIan Jackson <Ian.Jackson@eu.citrix.com>2011-01-11 19:28:22 +0000
committerIan Jackson <Ian.Jackson@eu.citrix.com>2011-01-11 19:28:22 +0000
commit1d80237d14c9bf7be01325765c35b5809ce0030e (patch)
treef4c5842a7ca39daf06833a38e074b3153c58d1f3 /tools/libxl/libxlu_cfg.c
parente23f7e77abb49296c53629dd3c72dec8e3a296dc (diff)
downloadxen-1d80237d14c9bf7be01325765c35b5809ce0030e.tar.gz
xen-1d80237d14c9bf7be01325765c35b5809ce0030e.tar.bz2
xen-1d80237d14c9bf7be01325765c35b5809ce0030e.zip
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@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxlu_cfg.c')
-rw-r--r--tools/libxl/libxlu_cfg.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/libxl/libxlu_cfg.c b/tools/libxl/libxlu_cfg.c
index 864a723009..1ade7eacda 100644
--- a/tools/libxl/libxlu_cfg.c
+++ b/tools/libxl/libxlu_cfg.c
@@ -93,6 +93,7 @@ int xlu_cfg_readdata(XLU_Config *cfg, const char *data, int length) {
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]);