GNOME Bugzilla – Bug 762435
memleaks in reverse/forward when calling _geocode_glib_cache_path_for_query()
Last modified: 2016-02-22 18:06:30 UTC
The return of _geocode_glib_cache_path_for_query() isn't being properly freed in GeocodeReverse/GeocodeForward. Patch following.
Created attachment 321821 [details] [review] Patch.
Review of attachment 321821 [details] [review]: Looks good to me.
Review of attachment 321821 [details] [review]: I would also add the output of valgrind showing the problem, for example.
(In reply to Bastien Nocera from comment #3) > Review of attachment 321821 [details] [review] [review]: > > I would also add the output of valgrind showing the problem, for example. It was actually just reading the code, didn't even run it under valgrind, but I can prepare a stupid test to showcase it.
(In reply to Aleksander Morgado from comment #4) > (In reply to Bastien Nocera from comment #3) > > Review of attachment 321821 [details] [review] [review] [review]: > > > > I would also add the output of valgrind showing the problem, for example. > > It was actually just reading the code, didn't even run it under valgrind, > but I can prepare a stupid test to showcase it. Then that'll do fine. Thanks for the patch!
Created attachment 321880 [details] Tester Too late, I wrote a tester :) ==3365== 128 bytes in 1 blocks are definitely lost in loss record 2,226 of 2,357 ==3365== at 0x4C2AB5D: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==3365== by 0x566A3E7: g_realloc (in /usr/lib/libglib-2.0.so.0.4600.2) ==3365== by 0x5685846: ??? (in /usr/lib/libglib-2.0.so.0.4600.2) ==3365== by 0x5685B66: g_string_insert_len (in /usr/lib/libglib-2.0.so.0.4600.2) ==3365== by 0x5650E77: ??? (in /usr/lib/libglib-2.0.so.0.4600.2) ==3365== by 0x5652214: g_build_filename (in /usr/lib/libglib-2.0.so.0.4600.2) ==3365== by 0x4E40AA0: _geocode_glib_cache_path_for_query (geocode-glib.c:92) ==3365== by 0x4E4052F: geocode_reverse_resolve_async (geocode-reverse.c:454) ==3365== by 0x400D55: main (in /home/aleksander/Development/clients/collabora/geocode-test)
Haha, thanks :)