examples/get: pull a leak with the GOptionContext

This commit is contained in:
Claudio Saavedra
2019-09-06 14:41:44 +03:00
parent 6b340f3352
commit 9c176e6057
+4 -2
View File
@@ -199,6 +199,7 @@ main (int argc, char **argv)
SoupURI *proxy_uri, *parsed;
GError *error = NULL;
SoupLogger *logger = NULL;
char *help;
opts = g_option_context_new (NULL);
g_option_context_add_main_entries (opts, entries, NULL);
@@ -213,8 +214,9 @@ main (int argc, char **argv)
}
if (argc != 2) {
g_printerr ("%s",
g_option_context_get_help (opts, TRUE, NULL));
help = g_option_context_get_help (opts, TRUE, NULL);
g_printerr ("%s", help);
g_free (help);
exit (1);
}
g_option_context_free (opts);