[eog] Fix a few memory leaks



commit 64cc76ccbfd7e5c59d007bfc1bac1c1365c501d7
Author: Boris Egorov <egorov linux com>
Date:   Wed Nov 19 10:26:22 2014 +0600

    Fix a few memory leaks
    
    Detected by Cppcheck
    
    Signed-off-by: Boris Egorov <egorov linux com>

 src/eog-thumb-view.c    |    1 +
 src/eog-uri-converter.c |    6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/eog-thumb-view.c b/src/eog-thumb-view.c
index 4ffd22e..7683ffd 100644
--- a/src/eog-thumb-view.c
+++ b/src/eog-thumb-view.c
@@ -490,6 +490,7 @@ thumbview_get_tooltip_string (EogImage *image)
                                       0, NULL, NULL);
        g_object_unref (file);
        if (file_info == NULL) {
+               g_free(bytes);
                return NULL;
        }
 
diff --git a/src/eog-uri-converter.c b/src/eog-uri-converter.c
index 5c2fe0a..86546c9 100644
--- a/src/eog-uri-converter.c
+++ b/src/eog-uri-converter.c
@@ -832,8 +832,10 @@ eog_uri_converter_preview (const char *format_str, EogImage *img, GdkPixbufForma
 
        str = g_string_new ("");
 
-       if (!g_utf8_validate (format_str, -1, NULL))
-           return NULL;
+       if (!g_utf8_validate (format_str, -1, NULL)) {
+               g_string_free(str, TRUE);
+               return NULL;
+       }
 
        len = g_utf8_strlen (format_str, -1);
        s = format_str;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]