From d01f58c9f78c07719c42d1973d57bc4f347481e7 Mon Sep 17 00:00:00 2001 From: Monsta Date: Mon, 3 Nov 2014 13:58:45 +0300 Subject: don't leak memory --- pluma/pluma-debug.c | 3 +-- pluma/pluma-plugin-info.c | 2 ++ pluma/pluma-style-scheme-manager.c | 2 ++ pluma/pluma-utils.c | 2 ++ pluma/pluma.c | 5 +++-- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pluma/pluma-debug.c b/pluma/pluma-debug.c index 510bfcb5..b35376b2 100644 --- a/pluma/pluma-debug.c +++ b/pluma/pluma-debug.c @@ -107,6 +107,7 @@ pluma_debug_message (PlumaDebugSection section, { #ifdef ENABLE_PROFILING gdouble seconds; + g_return_if_fail (timer != NULL); #endif va_list args; @@ -119,8 +120,6 @@ pluma_debug_message (PlumaDebugSection section, va_end (args); #ifdef ENABLE_PROFILING - g_return_if_fail (timer != NULL); - seconds = g_timer_elapsed (timer, NULL); g_print ("[%f (%f)] %s:%d (%s) %s\n", seconds, seconds - last, file, line, function, msg); diff --git a/pluma/pluma-plugin-info.c b/pluma/pluma-plugin-info.c index fd2dee36..ef8ab684 100644 --- a/pluma/pluma-plugin-info.c +++ b/pluma/pluma-plugin-info.c @@ -169,6 +169,7 @@ _pluma_plugin_info_new (const gchar *file) else { g_warning ("Could not find 'Module' in %s", file); + g_free (str); goto error; } @@ -198,6 +199,7 @@ _pluma_plugin_info_new (const gchar *file) { /* default to the C loader */ info->loader = g_strdup("c"); + g_free (str); } /* Get Name */ diff --git a/pluma/pluma-style-scheme-manager.c b/pluma/pluma-style-scheme-manager.c index c4f4aaf5..c43d6ffc 100644 --- a/pluma/pluma-style-scheme-manager.c +++ b/pluma/pluma-style-scheme-manager.c @@ -293,6 +293,8 @@ _pluma_style_scheme_manager_install_scheme (GtkSourceStyleSchemeManager *manager g_message ("Cannot install style scheme:\n%s", error->message); + g_free (dirname); + g_free (styles_dir); return NULL; } diff --git a/pluma/pluma-utils.c b/pluma/pluma-utils.c index 8e92d5fe..7879e71d 100644 --- a/pluma/pluma-utils.c +++ b/pluma/pluma-utils.c @@ -1380,6 +1380,8 @@ pluma_utils_drop_get_uris (GtkSelectionData *selection_data) uri_list[p++] = uri; } + g_strfreev (uris); + if (*uri_list == NULL) { g_free(uri_list); diff --git a/pluma/pluma.c b/pluma/pluma.c index 9e52bb90..8cd599dd 100644 --- a/pluma/pluma.c +++ b/pluma/pluma.c @@ -607,9 +607,10 @@ main (int argc, char *argv[]) if (!g_option_context_parse (context, &argc, &argv, &error)) { - g_print(_("%s\nRun '%s --help' to see a full list of available command line options.\n"), - error->message, argv[0]); + g_print(_("%s\nRun '%s --help' to see a full list of available command line options.\n"), + error->message, argv[0]); g_error_free (error); + g_option_context_free (context); return 1; } -- cgit v1.2.1