From a50de5d8273245b309833ac5a474b66421a9c2c4 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Mon, 23 Sep 2013 14:07:51 +0100 Subject: [PATCH] Fix crash on OOM when parsing disk security label If an OOM error occurs in virSecurityDeviceLabelDefParseXML the cleanup code may free an uninitialized pointer, causing a crash Signed-off-by: Daniel P. Berrange --- src/conf/domain_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 89535790c3..73ae0b0a64 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4507,7 +4507,7 @@ virSecurityDeviceLabelDefParseXML(virSecurityDeviceLabelDefPtr **seclabels_rtn, int nvmSeclabels, xmlXPathContextPtr ctxt, unsigned int flags) { - virSecurityDeviceLabelDefPtr *seclabels; + virSecurityDeviceLabelDefPtr *seclabels = NULL; size_t nseclabels = 0; int n; size_t i, j;