[PATCH] qemu_conf: Don't discard strdup OOM error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index e9a3407..7c3f317 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;
 
-- 
1.8.1.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]