From: Michal Privoznik Date: Thu, 25 Apr 2013 11:35:10 +0000 (+0200) Subject: qemu_conf: Don't discard strdup OOM error X-Git-Tag: v1.0.5-rc1~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ddbabf938b01e4700758078943b016d7a18414d;p=thirdparty%2Flibvirt.git qemu_conf: Don't discard strdup OOM error 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. --- diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index e9a3407ea1..7c3f317cf0 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -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;