[glib] glib-genmarshal: Fix memory leak with --prefix



commit 4f6dc3023205e9480bc4bb738bff06bd02d29567
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Sat Oct 3 11:33:00 2015 +0100

    glib-genmarshal: Fix memory leak with --prefix
    
    If --prefix is specified, marshaller_prefix is allocated and never
    freed. It does not actually have to be allocated — just use the static
    string from argv.
    
    Coverity CID: 1325370

 gobject/glib-genmarshal.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gobject/glib-genmarshal.c b/gobject/glib-genmarshal.c
index ca78a6f..ba13e44 100644
--- a/gobject/glib-genmarshal.c
+++ b/gobject/glib-genmarshal.c
@@ -993,10 +993,10 @@ parse_args (gint    *argc_p,
           gchar *equal = argv[i] + 8;
 
          if (*equal == '=')
-           marshaller_prefix = g_strdup (equal + 1);
+           marshaller_prefix = equal + 1;
          else if (i + 1 < argc)
            {
-             marshaller_prefix = g_strdup (argv[i + 1]);
+             marshaller_prefix = argv[i + 1];
              argv[i] = NULL;
              i += 1;
            }


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