[goffice] GOPixbuf: plug leak.



commit aad6c09cbece8920bc350e8ad4aa79299991affa
Author: Morten Welinder <terra gnome org>
Date:   Sun Mar 1 17:02:19 2015 -0500

    GOPixbuf: plug leak.

 ChangeLog                 |    1 +
 goffice/utils/go-pixbuf.c |    4 +++-
 2 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ec431b1..07db051 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@
 
        * goffice/utils/go-pixbuf.c (go_pixbuf_create_pixbuf): Avoid
        critical when loading fails.
+       (go_pixbuf_load_attr): Plug leak.
 
 2015-02-28  Morten Welinder  <terra gnome org>
 
diff --git a/goffice/utils/go-pixbuf.c b/goffice/utils/go-pixbuf.c
index e3f0229..6d2e4c7 100644
--- a/goffice/utils/go-pixbuf.c
+++ b/goffice/utils/go-pixbuf.c
@@ -108,8 +108,10 @@ go_pixbuf_load_attr (GOImage *image, xmlChar const *attr_name, xmlChar const *at
                long l = strtol (attr_value, NULL, 10);
                g_return_if_fail (l > 0 && l < G_MAXINT);
                pixbuf->rowstride = l;
-       } else if (!strcmp (attr_name, "image-type"))
+       } else if (!strcmp (attr_name, "image-type")) {
+               g_free (pixbuf->type);
                pixbuf->type = g_strdup (attr_value);
+       }
 }
 
 static void


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