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

[libvirt] [PATCH] vbox: don't crash if init fails early



Hi,
not having set up pfuncs already results in a core dump. O.k. to
apply?
Cheers,
 -- Guido
>From f01472982e8a00c98937a6f4a41c59a061a9ed98 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Guido=20G=C3=BCnther?= <agx sigxcpu org>
Date: Thu, 7 May 2009 10:31:21 +0200
Subject: [PATCH] don't crash if init fails early

---
 src/vbox/vbox_tmpl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 7297172..6507a69 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -291,7 +291,8 @@ static int vboxExtractVersion(virConnectPtr conn, vboxGlobalData *data) {
 }
 
 static void vboxUninitialize(vboxGlobalData *data) {
-    data->pFuncs->pfnComUninitialize();
+    if (data->pFuncs)
+        data->pFuncs->pfnComUninitialize();
     VBoxCGlueTerm();
 
     if (!data)
-- 
1.6.2.4


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