GNOME Bugzilla – Bug 169414
Memory leak in read_aliases
Last modified: 2006-05-17 14:02:10 UTC
Valgrind report: ==32043== 11 bytes in 1 blocks are definitely lost in loss record 1216 of 5240 ==32043== at 0x1B903C4D: malloc (vg_replace_malloc.c:131) ==32043== by 0x1C979B99: IA__g_malloc (gmem.c:137) ==32043== by 0x1C98C5B1: IA__g_strdup (gstrfuncs.c:90) ==32043== by 0x1C82CB93: read_aliases (bonobo-activation-get-language-list.c:102) ==32043== by 0x1C82CC47: unalias_lang (bonobo-activation-get-language-list.c:128) ==32043== by 0x1C82D1CC: bonobo_activation_i18n_get_language_list (bonobo-activation-get-language-list.c:361) ==32043== by 0x1C82D50D: get_lang_list (bonobo-activation-client.c:182) ==32043== by 0x1C82D5EC: bonobo_activation_register_client (bonobo-activation-client.c:221) ==32043== by 0x1C8300F8: bonobo_activation_existing_set (bonobo-activation-base-service.c:325) ==32043== by 0x1C830492: bonobo_activation_internal_service_get_extended (bonobo-activation-base-service.c:434) ==32043== by 0x1C830522: bonobo_activation_service_get (bonobo-activation-base-service.c:461) ==32043== by 0x1C832B59: bonobo_activation_activation_context_get (bonobo-activation-init.c:208) ==32043== by 0x1C832B77: bonobo_activation_object_directory_get (bonobo-activation-init.c:222) ==32043== by 0x1C831191: bonobo_activation_register_active_server_ext (bonobo-activation-register.c:287) ==32043== by 0x1C8310B9: bonobo_activation_register_active_server (bonobo-activation-register.c:222) ==32043== by 0x1C831558: bonobo_activation_active_server_register (bonobo-activation-register.c:418) ==32043== by 0x806280E: terminal_register_as_factory (terminal.c:3768) ==32043== by 0x806284F: terminal_invoke_factory (terminal.c:3784) ==32043== by 0x805E625: main (terminal.c:1698)
Created attachment 38351 [details] [review] patch Looks like there was a typo
Michael, can you review this patch please?
no idea - that code looks scary - particularly that key/values seem not to share obvious roles - ie. we insert 'shared_q' as both a key and a value: g_hash_table_insert (alias_table, shared_q, NULL); } g_hash_table_insert (alias_table, buf, shared_q); you'd need to get the original author to unwind / approve what's going on there, it's not obvious to me.
Alex, this is your code, right? Could you comment on the proposed patch?
Since gtk 2.6 we should be using g_get_language_list() instead anyway. This avoids using lots of memory. Attaching patch.
Created attachment 46482 [details] [review] Much better way to save memory
Please see bug 168948. The fix needs to be made because this code should be moved to libgnome (and not killed outright.)
So - we committed Alex's fix - so this should be closed I believe.