From: Ian Jackson Subject: [PATCH 1/3] libxl: config parser: do not segfault in some error paths Date: Tue, 11 Jan 2011 15:45:00 +0000 Message-ID: <1294760702-28809-2-git-send-email-ian.jackson@eu.citrix.com> References: <1294760702-28809-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1294760702-28809-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Ian Jackson , Ian Jackson List-Id: xen-devel@lists.xenproject.org In error paths, xlu__cfg_set_free can be called on NULL. So check for that rather than segfaulting. Signed-off-by: Ian Jackson --- tools/libxl/libxlu_cfg.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/tools/libxl/libxlu_cfg.c b/tools/libxl/libxlu_cfg.c index 864a723..1ade7ea 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; invalues; i++) free(set->values[i]); -- 1.5.6.5