diff --git a/src/mono/mono/component/debugger-agent.c b/src/mono/mono/component/debugger-agent.c index 81ea280734fdf8..088a8545d6df03 100644 --- a/src/mono/mono/component/debugger-agent.c +++ b/src/mono/mono/component/debugger-agent.c @@ -672,6 +672,7 @@ debugger_agent_parse_options (char *options) exit (1); } } + g_strfreev (args); if (agent_config.server && !agent_config.suspend) { /* Waiting for deferred attachment */ diff --git a/src/mono/mono/metadata/boehm-gc.c b/src/mono/mono/metadata/boehm-gc.c index 803f0693f7e255..c8e43d65514e98 100644 --- a/src/mono/mono/metadata/boehm-gc.c +++ b/src/mono/mono/metadata/boehm-gc.c @@ -142,6 +142,7 @@ mono_gc_base_init (void) } } g_free (env); + g_strfreev (opts); } } diff --git a/src/mono/mono/mini/driver.c b/src/mono/mono/mini/driver.c index fb57efb4897686..f5a25b152d7963 100644 --- a/src/mono/mono/mini/driver.c +++ b/src/mono/mono/mini/driver.c @@ -189,10 +189,8 @@ parse_optimizations (guint32 opt, const char* p, gboolean cpu_opts) exit (1); } } - - g_free (arg); } - g_free (parts); + g_strfreev (parts); return opt; } @@ -2208,15 +2206,13 @@ mono_main (int argc, char* argv[]) } else if (strncmp (argv [i], "--apply-bindings=", 17) == 0) { extra_bindings_config_file = &argv[i][17]; } else if (strncmp (argv [i], "--aot-path=", 11) == 0) { - char **split; + char **split, **ptr; split = g_strsplit (argv [i] + 11, G_SEARCHPATH_SEPARATOR_S, 1000); - while (*split) { - char *tmp = *split; - mono_aot_paths = g_list_append (mono_aot_paths, g_strdup (tmp)); - g_free (tmp); - split++; + for (ptr = split; ptr && *ptr; ptr++) { + mono_aot_paths = g_list_append (mono_aot_paths, g_strdup (*ptr)); } + g_strfreev (split); } else if (strncmp (argv [i], "--path=", 7) == 0) { paths = g_list_append (paths, argv [i] + 7); } else if (strncmp (argv [i], "--compile-all=", 14) == 0) { diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index db76fa7c13732d..3728c995e9dd96 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -8034,6 +8034,7 @@ interp_parse_options (const char *options) } } } + g_strfreev (args); } /*