From: Daniel P. Berrange Date: Mon, 23 Sep 2013 13:07:51 +0000 (+0100) Subject: Fix crash on OOM when parsing disk security label X-Git-Tag: v1.1.3-rc1~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a50de5d8273245b309833ac5a474b66421a9c2c4;p=thirdparty%2Flibvirt.git 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 --- 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;