[gimp/gimp-2-10] CID: 228176 Fix a Resource leak



commit 3d7d46ea97c8c1614b689858d6e5540b529fa53d
Author: Sabri Ünal <libreajans gmail com>
Date:   Wed Oct 23 12:32:11 2019 +0000

    CID: 228176 Fix a Resource leak
    
    This patch fixes a resource leak which was discovered by Coverity Scan.

 plug-ins/file-sgi/sgi.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/plug-ins/file-sgi/sgi.c b/plug-ins/file-sgi/sgi.c
index 3e6535a040..03cd01979a 100644
--- a/plug-ins/file-sgi/sgi.c
+++ b/plug-ins/file-sgi/sgi.c
@@ -331,6 +331,7 @@ load_image (const gchar  *filename,
       g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
                    _("Could not open '%s' for reading."),
                    gimp_filename_to_utf8 (filename));
+      free (sgip);
       return -1;
     };
 
@@ -345,6 +346,7 @@ load_image (const gchar  *filename,
     {
       g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
               _("Invalid width: %hu"), sgip->xsize);
+      free (sgip);
       return -1;
     }
 
@@ -352,6 +354,7 @@ load_image (const gchar  *filename,
     {
       g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
               _("Invalid height: %hu"), sgip->ysize);
+      free (sgip);
       return -1;
     }
 
@@ -359,6 +362,7 @@ load_image (const gchar  *filename,
     {
       g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
               _("Invalid number of channels: %hu"), sgip->zsize);
+      free (sgip);
       return -1;
     }
 
@@ -399,6 +403,7 @@ load_image (const gchar  *filename,
       g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
                    "Could not allocate new image: %s",
                    gimp_get_pdb_error());
+      free (sgip);
       return -1;
     }
 


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