[libvirt] [PATCH 1/2] parallels: fix parallelsDoCmdRun in case of command failure

Dmitry Guryanov dguryanov at parallels.com
Mon Sep 10 15:23:43 UTC 2012


Don't try to dereferece NULL pointer.
---
 src/parallels/parallels_utils.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/parallels/parallels_utils.c b/src/parallels/parallels_utils.c
index 35766b7..89a0d89 100644
--- a/src/parallels/parallels_utils.c
+++ b/src/parallels/parallels_utils.c
@@ -55,7 +55,7 @@ parallelsDoCmdRun(char **outbuf, const char *binary, va_list list)
   cleanup:
     VIR_FREE(scmd);
     virCommandFree(cmd);
-    if (ret)
+    if (ret && outbuf)
         VIR_FREE(*outbuf);
     return ret;
 }
-- 
1.7.1




More information about the libvir-list mailing list