tree-wide: Switch to autoptr for GOptionContext

We were leaking in a few places that I noticed in an ASAN run.  Also,
this was one of the last non-autoptr cleanup sections we have in
`out:` cleanup sections, making us a lot closer to a potential
full-tree rewrite to `return FALSE`.

Closes: #624
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2016-12-08 16:48:20 +00:00
1 parent 5155662b57
commit c19fae0282
48 files changed
+53 -160

No files matched your search

+1 -3
View File
@@ -61,7 +61,7 @@ cat_one_file (GFile *f,
gboolean
ostree_builtin_cat (int argc, char **argv, GCancellable *cancellable, GError **error)
{
GOptionContext *context;
g_autoptr(GOptionContext) context = NULL;
glnx_unref_object OstreeRepo *repo = NULL;
gboolean ret = FALSE;
int i;
@@ -98,7 +98,5 @@ ostree_builtin_cat (int argc, char **argv, GCancellable *cancellable, GError **e
ret = TRUE;
out:
if (context)
g_option_context_free (context);
return ret;
}