[Spice-commits] server/reds.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Thu Nov 17 11:09:48 UTC 2016


 server/reds.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit e31c108417eee9d35425ead48d383c0f2cb5d1b2
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Thu Nov 17 09:19:17 2016 +0000

    Make sure statistic file are initialized even if init is not called
    
    This caused a NULL pointer dereference executing some tests
    calling spice_server_destroy.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/server/reds.c b/server/reds.c
index 9a3f06e..dd173d9 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3358,10 +3358,6 @@ static int do_spice_init(RedsState *reds, SpiceCoreInterface *core_interface)
         spice_error("migration timer create failed");
     }
 
-#ifdef RED_STATISTICS
-    reds->stat_file = stat_file_new(REDS_MAX_STAT_NODES);
-#endif
-
     if (reds_init_net(reds) < 0) {
         goto err;
     }
@@ -3437,6 +3433,9 @@ SPICE_GNUC_VISIBLE SpiceServer *spice_server_new(void)
     reds->config->agent_copypaste = TRUE;
     reds->config->agent_file_xfer = TRUE;
     reds->config->exit_on_disconnect = FALSE;
+#ifdef RED_STATISTICS
+    reds->stat_file = stat_file_new(REDS_MAX_STAT_NODES);
+#endif
     return reds;
 }
 


More information about the Spice-commits mailing list