提交 1fff45cc 编写于 作者: D Daniel P. Berrange

Avoid leak if virDomainSoundCodecDefParseXML return error

If virDomainSoundCodecDefParseXML returns an error (eg due
to OOM), then the xml nodeset codecNodes is leaked.
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 fbf8e1c3
......@@ -8472,8 +8472,10 @@ virDomainSoundDefParseXML(const xmlNodePtr node,
for (i = 0; i < ncodecs; i++) {
virDomainSoundCodecDefPtr codec = virDomainSoundCodecDefParseXML(codecNodes[i]);
if (codec == NULL)
if (codec == NULL) {
VIR_FREE(codecNodes);
goto error;
}
codec->cad = def->ncodecs; /* that will do for now */
def->codecs[def->ncodecs++] = codec;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册