render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
Daniel Veillard 263e2f
Daniel Veillard 263e2f
	Avoid segfault upon early libvirtd failure.
Daniel Veillard 263e2f
	* qemud/qemud.c (main): Don't call qemudCleanup on an
Daniel Veillard 263e2f
	uninitialized pointer.
Daniel Veillard 263e2f
Daniel Veillard 263e2f
By the way, even though this evoked a warning from gcc,
Daniel Veillard 263e2f
"make distcheck" passes.  Obviously, that means the distcheck
Daniel Veillard 263e2f
rule is inadequate.  I'll fix it so that it turns on -Werror
Daniel Veillard 263e2f
for the final build.
Daniel Veillard 263e2f
Daniel Veillard 263e2f
Signed-off-by: Jim Meyering <meyering@redhat.com>
Daniel Veillard 263e2f
---
Daniel Veillard 263e2f
 qemud/qemud.c |    5 +++--
Daniel Veillard 263e2f
 1 files changed, 3 insertions(+), 2 deletions(-)
Daniel Veillard 263e2f
Daniel Veillard 263e2f
diff --git a/qemud/qemud.c b/qemud/qemud.c
Daniel Veillard 263e2f
index 96fdf32..b6b82ed 100644
Daniel Veillard 263e2f
--- a/qemud/qemud.c
Daniel Veillard 263e2f
+++ b/qemud/qemud.c
Daniel Veillard 263e2f
@@ -2025,7 +2025,7 @@ libvirt management daemon:\n\
Daniel Veillard 263e2f
Daniel Veillard 263e2f
 #define MAX_LISTEN 5
Daniel Veillard 263e2f
 int main(int argc, char **argv) {
Daniel Veillard 263e2f
-    struct qemud_server *server;
Daniel Veillard 263e2f
+    struct qemud_server *server = NULL;
Daniel Veillard 263e2f
     struct sigaction sig_action;
Daniel Veillard 263e2f
     int sigpipe[2];
Daniel Veillard 263e2f
     const char *pid_file = NULL;
Daniel Veillard 263e2f
@@ -2180,7 +2180,8 @@ int main(int argc, char **argv) {
Daniel Veillard 263e2f
         unlink (pid_file);
Daniel Veillard 263e2f
Daniel Veillard 263e2f
  error1:
Daniel Veillard 263e2f
-    qemudCleanup(server);
Daniel Veillard 263e2f
+    if (server)
Daniel Veillard 263e2f
+        qemudCleanup(server);
Daniel Veillard 263e2f
     return ret;
Daniel Veillard 263e2f
 }
Daniel Veillard 263e2f