summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonsta <[email protected]>2014-11-03 13:58:45 +0300
committerinfirit <[email protected]>2014-12-19 13:56:35 +0100
commitd01f58c9f78c07719c42d1973d57bc4f347481e7 (patch)
tree28bd090067ace897a023fa438945fa6b6e0e9e04
parent4a79fb544f5c35843d536d73d60bc10f52ba7d4c (diff)
downloadpluma-d01f58c9f78c07719c42d1973d57bc4f347481e7.tar.bz2
pluma-d01f58c9f78c07719c42d1973d57bc4f347481e7.tar.xz
don't leak memory
-rw-r--r--pluma/pluma-debug.c3
-rw-r--r--pluma/pluma-plugin-info.c2
-rw-r--r--pluma/pluma-style-scheme-manager.c2
-rw-r--r--pluma/pluma-utils.c2
-rw-r--r--pluma/pluma.c5
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;
}