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
This commit is contained in:
Philip Withnall 2015-10-03 11:33:00 +01:00
parent 292fd1155a
commit 4f6dc30232

View File

@ -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;
}