From: Daniel P. Berrange Date: Wed, 25 Sep 2013 10:31:26 +0000 (+0100) Subject: Add missing check for OOM with virVMXEscapeHexPipe X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1f66001c6996d5f4f96d072a74304452c2236925;p=libvirt.git Add missing check for OOM with virVMXEscapeHexPipe The virVMXFormatConfig called virVMXEscapeHexPipe but forgot to check for OOM. This caused data to silently be lost. Signed-off-by: Daniel P. Berrange --- diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 5c2c79430f..38b7cc0e92 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -3096,7 +3096,8 @@ virVMXFormatConfig(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virDomainDe /* def:description -> vmx:annotation */ if (def->description != NULL) { - annotation = virVMXEscapeHexPipe(def->description); + if (!(annotation = virVMXEscapeHexPipe(def->description))) + goto cleanup; virBufferAsprintf(&buffer, "annotation = \"%s\"\n", annotation); }