]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu_conf: Don't discard strdup OOM error
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 25 Apr 2013 11:35:10 +0000 (13:35 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 25 Apr 2013 11:45:37 +0000 (13:45 +0200)
After 78d7c3c5 we are strdup()-ing path to qemu-bridge-helper.
However, the check for its return value is missing. So it is
possible we've ignored the OOM error silently.

src/qemu/qemu_conf.c

index e9a3407ea10fdc4f649a7c78bc43be070ad63123..7c3f317cf0d2e94f5770fd24a64f2c8c35a43719 100644 (file)
@@ -241,7 +241,8 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged)
         }
     }
 #endif
-    cfg->bridgeHelperName = strdup("/usr/libexec/qemu-bridge-helper");
+    if (!(cfg->bridgeHelperName = strdup("/usr/libexec/qemu-bridge-helper")))
+        goto no_memory;
 
     cfg->clearEmulatorCapabilities = true;