From 4f6dc3023205e9480bc4bb738bff06bd02d29567 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Sat, 3 Oct 2015 11:33:00 +0100 Subject: [PATCH] glib-genmarshal: Fix memory leak with --prefix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gobject/glib-genmarshal.c b/gobject/glib-genmarshal.c index ca78a6f76..ba13e4414 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; }