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

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



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


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