don't leak memory

This commit is contained in:
Monsta 2014-11-03 13:58:45 +03:00 committed by infirit
parent 4a79fb544f
commit d01f58c9f7
5 changed files with 10 additions and 4 deletions

View File

@ -107,6 +107,7 @@ pluma_debug_message (PlumaDebugSection section,
{ {
#ifdef ENABLE_PROFILING #ifdef ENABLE_PROFILING
gdouble seconds; gdouble seconds;
g_return_if_fail (timer != NULL);
#endif #endif
va_list args; va_list args;
@ -119,8 +120,6 @@ pluma_debug_message (PlumaDebugSection section,
va_end (args); va_end (args);
#ifdef ENABLE_PROFILING #ifdef ENABLE_PROFILING
g_return_if_fail (timer != NULL);
seconds = g_timer_elapsed (timer, NULL); seconds = g_timer_elapsed (timer, NULL);
g_print ("[%f (%f)] %s:%d (%s) %s\n", g_print ("[%f (%f)] %s:%d (%s) %s\n",
seconds, seconds - last, file, line, function, msg); seconds, seconds - last, file, line, function, msg);

View File

@ -169,6 +169,7 @@ _pluma_plugin_info_new (const gchar *file)
else else
{ {
g_warning ("Could not find 'Module' in %s", file); g_warning ("Could not find 'Module' in %s", file);
g_free (str);
goto error; goto error;
} }
@ -198,6 +199,7 @@ _pluma_plugin_info_new (const gchar *file)
{ {
/* default to the C loader */ /* default to the C loader */
info->loader = g_strdup("c"); info->loader = g_strdup("c");
g_free (str);
} }
/* Get Name */ /* Get Name */

View File

@ -293,6 +293,8 @@ _pluma_style_scheme_manager_install_scheme (GtkSourceStyleSchemeManager *manager
g_message ("Cannot install style scheme:\n%s", g_message ("Cannot install style scheme:\n%s",
error->message); error->message);
g_free (dirname);
g_free (styles_dir);
return NULL; return NULL;
} }

View File

@ -1380,6 +1380,8 @@ pluma_utils_drop_get_uris (GtkSelectionData *selection_data)
uri_list[p++] = uri; uri_list[p++] = uri;
} }
g_strfreev (uris);
if (*uri_list == NULL) if (*uri_list == NULL)
{ {
g_free(uri_list); g_free(uri_list);

View File

@ -607,9 +607,10 @@ main (int argc, char *argv[])
if (!g_option_context_parse (context, &argc, &argv, &error)) 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"), g_print(_("%s\nRun '%s --help' to see a full list of available command line options.\n"),
error->message, argv[0]); error->message, argv[0]);
g_error_free (error); g_error_free (error);
g_option_context_free (context);
return 1; return 1;
} }