GNOME Bugzilla – Bug 649508
StTextureCache: plug leak in not-found icon case
Last modified: 2011-05-24 17:16:20 UTC
==13810== 44 bytes in 1 blocks are definitely lost in loss record 12,513 of 18,765 ==13810== at 0x4006D69: malloc (vg_replace_malloc.c:236) ==13810== by 0x5191BCA: standard_malloc (gmem.c:88) ==13810== by 0x519201F: g_malloc (gmem.c:164) ==13810== by 0x51A9C2A: g_strdup (gstrfuncs.c:102) ==13810== by 0x40624D5: load_gicon_with_colors (st-texture-cache.c:1157) ==13810== by 0x4030E50: shell_app_info_create_icon_texture (shell-app-system.c:1359) ==13810== by 0x4C2771BF: ffi_call (ffi.c:326) ==13810== by 0x7D56A37: gjs_invoke_c_function (function.c:638) ==13810== by 0x7D57A48: function_call (function.c:884) ==13810== by 0x426A64A: js::Invoke(JSContext*, js::CallArgs const&, unsigned int) (in /src/build/jhbuild/lib/libmozjs185.so.1.0.0) ==13810== by 0x42570F5: js::Interpret(JSContext*, JSStackFrame*, unsigned int, JSInterpMode) (in /src/build/jhbuild/lib/libmozjs185.so.1.0.0) ==13810== by 0x426A07F: js::RunScript(JSContext*, JSScript*, JSStackFrame*) (in /src/build/jhbuild/lib/libmozjs185.so.1.0.0)
Created attachment 187320 [details] [review] StTextureCache: plug leak in not-found icon case
Review of attachment 187320 [details] [review]: Looks good.
Attachment 187320 [details] pushed as dcd07eb - StTextureCache: plug leak in not-found icon case
The applied patch makes the two branches of the if statement inconsistent, and thus cannot be fully correct. if (info != NULL) { request->key = g_strdup (key); [...] } else { g_free (request->key); } From my reading this change was correct but we always leak the initial setting of request->key in the _found_ case, so the assignment to request->key in the found case should be removed but please double check that.
Created attachment 188483 [details] [review] StTextureCache: Fix leak of key string Also micro-optimize by avoiding another strdup(), instead pass ownership of the string when we can.
Review of attachment 188483 [details] [review]: Looks right to me
Attachment 188483 [details] pushed as fdefb31 - StTextureCache: Fix leak of key string