From 9c176e60576a0f1168ce0100846bf1da0160db0f Mon Sep 17 00:00:00 2001 From: Claudio Saavedra Date: Fri, 6 Sep 2019 14:41:44 +0300 Subject: [PATCH] examples/get: pull a leak with the GOptionContext --- examples/get.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/get.c b/examples/get.c index f3380b59..00dbbddf 100644 --- a/examples/get.c +++ b/examples/get.c @@ -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);