[gimp] gimptagcache: free error to avoid leak



commit 76b11a5f69b88e9cb1ed36962d09e941edbd2de9
Author: Andrzej Hunt <andrzej ahunt org>
Date:   Fri Aug 27 17:12:27 2021 +0200

    gimptagcache: free error to avoid leak
    
    If gimp_xml_parser_parse_gfile returns FALSE, we know that error might
    be set. Therefore we add a g_error_free to avoid leaking the error.

 app/core/gimptagcache.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/app/core/gimptagcache.c b/app/core/gimptagcache.c
index e4ef0da287..f7b840e722 100644
--- a/app/core/gimptagcache.c
+++ b/app/core/gimptagcache.c
@@ -511,6 +511,10 @@ gimp_tag_cache_load (GimpTagCache *cache)
     {
       g_printerr ("Failed to parse tag cache: %s\n",
                   error ? error->message : "WTF unknown error");
+      if (error)
+        {
+          g_error_free (error);
+        }
     }
 
   g_object_unref (file);


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