[gimp] libgimpcolor: don't leak the path in gimp_color_profile_new_from_file()



commit 086dc605051193581676c22ade92ace308796928
Author: Michael Natterer <mitch gimp org>
Date:   Wed May 4 18:58:37 2016 +0200

    libgimpcolor: don't leak the path in gimp_color_profile_new_from_file()

 libgimpcolor/gimpcolorprofile.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/libgimpcolor/gimpcolorprofile.c b/libgimpcolor/gimpcolorprofile.c
index 05c2e68..bab7f79 100644
--- a/libgimpcolor/gimpcolorprofile.c
+++ b/libgimpcolor/gimpcolorprofile.c
@@ -184,9 +184,10 @@ gimp_color_profile_new_from_file (GFile   *file,
 
   if (path)
     {
-      GMappedFile  *mapped;
+      GMappedFile *mapped;
 
       mapped = g_mapped_file_new (path, FALSE, error);
+      g_free (path);
 
       if (! mapped)
         return NULL;
@@ -521,7 +522,7 @@ gimp_color_profile_get_copyright (GimpColorProfile *profile)
  * string that can be used to label the profile in a user interface.
  *
  * Unlike gimp_color_profile_get_description(), this function always
- * returns a string (as a fallback, it returns "(unnamed profile)".
+ * returns a string (as a fallback, it returns "(unnamed profile)").
  *
  * Return value: the @profile's label. The returned value belongs to
  *               @profile and must not be modified or freed.


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