[gnome-bluetooth] wizard: fix segfault when connection is retried before timeout expires



commit 691225e963cdec181193d2bc79577601087b36f2
Author: Daniele Forsi <dforsi src gnome org>
Date:   Sun Dec 11 22:55:01 2011 +0100

    wizard: fix segfault when connection is retried before timeout expires
    
    When retrying, the callback gets a pointer to the original ConnectData so
    it can be freed only on the final run.
    
    Fixes:
    Program received signal SIGSEGV, Segmentation fault.
    0x008549a6 in g_timer_elapsed () from /lib/i386-linux-gnu/libglib-2.0.so.0
    (gdb) bt
     #0  0x008549a6 in g_timer_elapsed () from /lib/i386-linux-gnu/libglib-2.0.so.0
     #1  0x0804ba63 in connect_callback (source_object=0x8077d00, res=0x81d7a00, user_data=0xb7415f78) at /home/Programmazione/gnome-bluetooth/wizard/main.c:365
     #2  0x006b2aef in g_simple_async_result_complete () from /usr/lib/i386-linux-gnu/libgio-2.0.so.0
     #3  0x006b2c1b in ?? () from /usr/lib/i386-linux-gnu/libgio-2.0.so.0
     #4  0x00826110 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
     #5  0x0082a25f in g_main_context_dispatch () from /lib/i386-linux-gnu/libglib-2.0.so.0
     #6  0x0082a990 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
     #7  0x0082af9b in g_main_loop_run () from /lib/i386-linux-gnu/libglib-2.0.so.0
     #8  0x002aef95 in gtk_main () from /usr/lib/libgtk-3.so.0
     #9  0x001c2fe4 in ?? () from /usr/lib/libgtk-3.so.0
     #10 0x006e650c in g_application_run () from /usr/lib/i386-linux-gnu/libgio-2.0.so.0
     #11 0x0804b19f in main (argc=1, argv=0xbffff6b4) at /home/Programmazione/gnome-bluetooth/wizard/main.c:907

 wizard/main.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/wizard/main.c b/wizard/main.c
index c3e2f49..3d75ece 100644
--- a/wizard/main.c
+++ b/wizard/main.c
@@ -351,6 +351,7 @@ connect_callback (GObject      *source_object,
 
 	if (success == FALSE && g_timer_elapsed (data->timer, NULL) < CONNECT_TIMEOUT) {
 		bluetooth_client_connect_service (client, data->path, TRUE, NULL, connect_callback, data);
+		return;
 	}
 
 	if (success == FALSE)



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