]> xenbits.xensource.com Git - libvirt.git/commitdiff
Add missing check for OOM with virVMXEscapeHexPipe
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 25 Sep 2013 10:31:26 +0000 (11:31 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 25 Sep 2013 17:12:09 +0000 (18:12 +0100)
The virVMXFormatConfig called virVMXEscapeHexPipe but
forgot to check for OOM. This caused data to silently
be lost.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/vmx/vmx.c

index 5c2c79430f158d738b84807d2da9311d76ac770b..38b7cc0e921a1f8940fde6b91a3cd65091333b2d 100644 (file)
@@ -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);
     }