GNOME Bugzilla – Bug 787410
entry: fix memory leak
Last modified: 2017-09-07 14:21:00 UTC
.
Created attachment 359354 [details] [review] entry: fix memory leak
Great, many thanks for catching that - I was sure that get_tooltip_text() returned a const char*... but of course, it doesn't. I pushed a cosmetically tweaked version of the fix to all 3 branches.
(In reply to Daniel Boles from comment #2) > Great, many thanks for catching that - I was sure that get_tooltip_text() > returned a const char*... but of course, it doesn't. > > I pushed a cosmetically tweaked version of the fix to all 3 branches. A few suggestions: DON'T EVER EVER change the Author name unless the change you made is really big (This should be taken very seriously). gtk_widget_get_tooltip_text returns NULL or a valid text, freeing a NULL isn't an error, so the else is redundant (unless the function is run a million+ times, and the return value is NULL 99% of the time). Thanks
(In reply to Mohammed Sadiq from comment #3) > DON'T EVER EVER change the Author name unless the change you made is really > big (This should be taken very seriously). Apologies for the offence; I rewrote the commit but should've specifically set you as the author. > gtk_widget_get_tooltip_text returns NULL or a valid text, freeing a NULL > isn't an error, so the else is redundant (unless the function is run a > million+ times, and the return value is NULL 99% of the time). Sure, I guess this is just a pointless cosmetic preference I have. Thanks again for the fix.
(In reply to Daniel Boles from comment #4) > Apologies for the offence; I rewrote the commit but should've specifically > set you as the author. > This is not only for credit, but also for the blames. You don't need to get blamed for some one else's code, right? :-)