[PATCH spice-server] test-listen: Fix some use after free

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

 



Do not dereference thread_data after has been freed.

Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 server/tests/test-listen.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/tests/test-listen.c b/server/tests/test-listen.c
index 531bd1bd..c63ee17e 100644
--- a/server/tests/test-listen.c
+++ b/server/tests/test-listen.c
@@ -174,9 +174,9 @@ static gpointer check_magic_thread(gpointer data)
 
     g_object_unref(stream);
     g_object_unref(connectable);
-    g_free(thread_data);
 
     test_event_loop_quit(thread_data->event_loop);
+    g_free(thread_data);
 
     return NULL;
 }
@@ -194,9 +194,9 @@ static gpointer check_no_connect_thread(gpointer data)
     g_clear_error(&error);
 
     g_object_unref(connectable);
-    g_free(thread_data);
 
     test_event_loop_quit(thread_data->event_loop);
+    g_free(thread_data);
 
     return NULL;
 }
-- 
2.14.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]