[libsoup/leaks: 3/5] examples/get: pull a leak with the GOptionContext



commit b88978b0a10a8c1dcb54e99c5034281c3f5a8a95
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Fri Sep 6 14:41:44 2019 +0300

    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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]