[eog] Fix two more memory leaks
- From: Felix Riemann <friemann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [eog] Fix two more memory leaks
- Date: Wed, 19 Nov 2014 19:53:52 +0000 (UTC)
commit a9be9741fce0b9be0e0d4f9051c576e449b5a1b0
Author: Felix Riemann <friemann gnome org>
Date: Wed Nov 19 20:31:25 2014 +0100
Fix two more memory leaks
Taken from a Cppcheck report provided by Boris Egorov.
https://bugzilla.gnome.org/show_bug.cgi?id=740348
src/eog-debug.c | 10 +++++-----
src/eog-metadata-sidebar.c | 1 +
2 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/eog-debug.c b/src/eog-debug.c
index 0462d68..1be3906 100644
--- a/src/eog-debug.c
+++ b/src/eog-debug.c
@@ -106,12 +106,14 @@ eog_debug_message (EogDebug section,
{
if (G_UNLIKELY (debug & section))
{
+ va_list args;
+ gchar *msg;
+
#ifdef ENABLE_PROFILING
gdouble seconds;
-#endif
- va_list args;
- gchar *msg;
+ g_return_if_fail (timer != NULL);
+#endif
g_return_if_fail (format != NULL);
@@ -120,8 +122,6 @@ eog_debug_message (EogDebug 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/src/eog-metadata-sidebar.c b/src/eog-metadata-sidebar.c
index 2ff6d4f..8477a01 100644
--- a/src/eog-metadata-sidebar.c
+++ b/src/eog-metadata-sidebar.c
@@ -113,6 +113,7 @@ _gtk_grid_append_title_line (GtkGrid *grid, GtkWidget *sibling,
markup = g_markup_printf_escaped ("<b>%s</b>", text);
gtk_label_set_markup (GTK_LABEL (label), markup);
+ g_free (markup);
gtk_grid_attach_next_to (grid, label, sibling, GTK_POS_BOTTOM, 2, 1);
return label;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]