Without the patch it modifies a copy, not the original, that's the bug. Look at the code paths exiting that function (lines modified by this patch) that do... free(test); test = strdup(...); return TRUE; This allocates a string and stores the pointer to it in the function-local char * "test" which is immediately leaked and does not modify or write to the address of the original. The original still points at what it did previously, memory which has now been freed. To store the char * of the new string...
update icon names to non-deprecated replacements (since GTK 3.10)
fix use-after-free / fixup trans_lang_get_similar