]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Add missing check for OOM when building boot menu args
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 23 Sep 2013 14:11:19 +0000 (15:11 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 24 Sep 2013 15:58:23 +0000 (16:58 +0100)
When building boot menu args, if OOM occurred the CLI args
would end up containing  'order=(null)' due to a missing
call to 'virBufferError'.

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

index 850cceaa26ef9aac5f412ea87acf688ab8c04fec..9900b411f8663d163c510f88fc0145920fb7944b 100644 (file)
@@ -8057,6 +8057,11 @@ qemuBuildCommandLine(virConnectPtr conn,
         if (boot_nparams > 0) {
             virCommandAddArg(cmd, "-boot");
 
+            if (virBufferError(&boot_buf)) {
+                virReportOOMError();
+                goto error;
+            }
+
             if (boot_nparams < 2 || emitBootindex) {
                 virCommandAddArgBuffer(cmd, &boot_buf);
                 virBufferFreeAndReset(&boot_buf);