diff --git a/moo/mooedit/mooedit-fileops.c b/moo/mooedit/mooedit-fileops.c index b13b2b59..628b23c9 100644 --- a/moo/mooedit/mooedit-fileops.c +++ b/moo/mooedit/mooedit-fileops.c @@ -100,11 +100,14 @@ normalize_encoding (const char *encoding, gboolean _moo_edit_file_is_new (GFile *file) { + gboolean is_new; char *filename; moo_return_val_if_fail (G_IS_FILE (file), FALSE); filename = g_file_get_path (file); moo_return_val_if_fail (filename != NULL, FALSE); - return !g_file_test (filename, G_FILE_TEST_EXISTS); + is_new = !g_file_test (filename, G_FILE_TEST_EXISTS); + g_free (filename); + return is_new; } @@ -931,6 +934,7 @@ do_save_local (MooEdit *edit, { to_save = encoded; to_save_size = bytes_written; + freeme = encoded; } else { diff --git a/moo/mooutils/mooutils-file.c b/moo/mooutils/mooutils-file.c index 7410fcb9..5dbbb6cf 100644 --- a/moo/mooutils/mooutils-file.c +++ b/moo/mooutils/mooutils-file.c @@ -17,6 +17,7 @@ moo_file_fnmatch (GFile *file, const char *glob) { char *filename; + gboolean ret; moo_return_val_if_fail (G_IS_FILE (file), FALSE); moo_return_val_if_fail (glob != NULL, FALSE); @@ -24,5 +25,8 @@ moo_file_fnmatch (GFile *file, filename = g_file_get_path (file); moo_return_val_if_fail (filename != NULL, FALSE); - return fnmatch (glob, filename, 0) == 0; + ret = fnmatch (glob, filename, 0) == 0; + + g_free (filename); + return ret; } diff --git a/moo/mooutils/mooutils-misc.c b/moo/mooutils/mooutils-misc.c index 5bb4953a..a648322e 100644 --- a/moo/mooutils/mooutils-misc.c +++ b/moo/mooutils/mooutils-misc.c @@ -1969,11 +1969,13 @@ moo_log_debug_enabled (void) void _moo_logv (MooCodeLoc loc, GLogLevelFlags flags, const char *format, va_list args) { - char *message = g_strdup_vprintf (format, args); + char *message; if (flags >= G_LOG_LEVEL_DEBUG && !moo_log_debug_enabled ()) return; + message = g_strdup_vprintf (format, args); + #if defined(MOO_DEV_MODE) && !defined(__WIN32__) if (flags < G_LOG_LEVEL_MESSAGE) { diff --git a/tools/medit.supp b/tools/medit.supp index 407c691c..9f822136 100644 --- a/tools/medit.supp +++ b/tools/medit.supp @@ -210,3 +210,44 @@ obj:/usr/lib/libgobject-2.0.so* fun:g_type_register_static } + +{ + + Memcheck:Addr1 + fun:g_utf8_pointer_to_offset + fun:g_utf8_pointer_to_offset + fun:regex_fetch_pos + fun:apply_sub_patterns +} + +{ + + Memcheck:Leak + fun:malloc + fun:_XEnq + obj:/usr/lib/libX11.so.6.3.0 + fun:_XReadEvents + fun:XIfEvent + fun:gdk_x11_get_server_time +} + +{ + + Memcheck:Leak + ... + fun:gtk_rc_parse_string +} + +{ + + Memcheck:Leak + ... + fun:gtk_rc_get_style +} + +{ + + Memcheck:Leak + ... + fun:gdk_window_focus +}