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

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



On 25/04/13 19:37, Michal Privoznik wrote:
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;
ACK


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