GNOME Bugzilla – Bug 788158
info: Use g_auto to reduce memory leaks
Last modified: 2018-01-23 02:30:23 UTC
Created attachment 360385 [details] [review] info: Use g_auto for variables Use the g_auto macros to reduce memory leaks. There were a couple found making this patch.
Created attachment 360386 [details] [review] info: Use g_auto for variables Missed some g_strfreev.
Review of attachment 360386 [details] [review]: Hi Robert, thanks for your patch. Could you please update it to the latest master? It does not apply cleanly anymore.
Created attachment 367190 [details] [review] info: Use g_auto for variables Rebased on master
Review of attachment 367190 [details] [review]: Two other comments. Besides them, the patch looks pretty good. ::: panels/info/cc-info-default-apps-panel.c @@ -93,1 @@ error = NULL; Hm... I think this might be a memory leak. I think this was a valid case of autoptr + free. If you set to NULL but not free, when the block ends, nothing will be freed where it clearly should. ::: panels/info/info-cleanup.c @@ +95,3 @@ + char *new; + g_autoptr(GRegex) re = NULL; + g_autoptr(GError) error = NULL; Could change to 'gchar' since you're already touching it.
Created attachment 367270 [details] [review] nfo: Use g_auto for variables Fixed up issues as requested and tided up some other uses of GError and char *.
Created attachment 367271 [details] [review] info: Use g_auto for variables Typo in previous commit
Thanks! Push with a minor correction (the second GError should be called 'local_error' to avoid shadowing the first one.) Attachment 367271 [details] pushed as 1e62c99 - info: Use g_auto for variables