Bug 32140

Summary: Don't try to free search results when there are none
Product: Telepathy Reporter: Emilio Pozuelo Monfort <pochu27>
Component: loggerAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium    
Version: git master   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Don't try to free the search results if there are none

Description Emilio Pozuelo Monfort 2010-12-06 09:13:26 UTC
When calling tpl_log_manager_search_async(), if there are no matchs, lst will be NULL but we will try to free it nonetheless. The attached patch fixes it by only calling the free func if there are search results.


tp-logger-CRITICAL **: _search_new_async_result_free: assertion `data != NULL' failed
aborting...

Program received signal SIGTRAP, Trace/breakpoint trap.
g_logv (log_domain=<value optimized out>, log_level=<value optimized out>, format=<value optimized out>, 
    args1=0x7fffffffe350) at /tmp/buildd/glib2.0-2.27.4/glib/gmessages.c:563
563	/tmp/buildd/glib2.0-2.27.4/glib/gmessages.c: No such file or directory.
	in /tmp/buildd/glib2.0-2.27.4/glib/gmessages.c
(gdb) bt
#0  g_logv (log_domain=<value optimized out>, log_level=<value optimized out>, format=<value optimized out>, 
    args1=0x7fffffffe350) at /tmp/buildd/glib2.0-2.27.4/glib/gmessages.c:563
#1  0x00007ffff0703453 in g_log (log_domain=0x7ffff06b0e40 "", log_level=0, format=0x1 <Address 0x1 out of bounds>)
    at /tmp/buildd/glib2.0-2.27.4/glib/gmessages.c:577
#2  0x00007ffff2724657 in clear_op_res (object=0x7fffe4004400)
    at /tmp/buildd/glib2.0-2.27.4/gio/gsimpleasyncresult.c:256
#3  g_simple_async_result_finalize (object=0x7fffe4004400) at /tmp/buildd/glib2.0-2.27.4/gio/gsimpleasyncresult.c:274
#4  0x00007ffff0fbb814 in g_object_unref (_object=<value optimized out>)
    at /tmp/buildd/glib2.0-2.27.4/gobject/gobject.c:2714
#5  0x00007ffff27237de in complete_in_idle_cb_for_thread (_data=<value optimized out>)
    at /tmp/buildd/glib2.0-2.27.4/gio/gsimpleasyncresult.c:817
#6  0x00007ffff06f80f2 in g_main_dispatch (context=0x72c590) at /tmp/buildd/glib2.0-2.27.4/glib/gmain.c:2436
#7  g_main_context_dispatch (context=0x72c590) at /tmp/buildd/glib2.0-2.27.4/glib/gmain.c:3009
#8  0x00007ffff06fc7b8 in g_main_context_iterate (context=0x72c590, block=<value optimized out>, 
    dispatch=<value optimized out>, self=<value optimized out>) at /tmp/buildd/glib2.0-2.27.4/glib/gmain.c:3087
#9  0x00007ffff06fccc5 in g_main_loop_run (loop=0x778f20) at /tmp/buildd/glib2.0-2.27.4/glib/gmain.c:3295
#10 0x00007ffff360e0fd in gtk_main () at /tmp/buildd/gtk+3.0-2.91.5/gtk/gtkmain.c:1297
#11 0x00007ffff274e69c in g_application_run (application=0x768030, argc=<value optimized out>, 
    argv=<value optimized out>) at /tmp/buildd/glib2.0-2.27.4/gio/gapplication.c:1216
#12 0x00000000004488a2 in main (argc=1, argv=0x7fffffffe7e8) at empathy.c:725
Comment 1 Emilio Pozuelo Monfort 2010-12-06 09:14:25 UTC
Created attachment 40837 [details] [review]
Don't try to free the search results if there are none
Comment 2 Emilio Pozuelo Monfort 2010-12-06 09:32:40 UTC
I have fixed it differently, and Sjoerd has reviewed it.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.