[gimp] CID 227971: Resource leak



commit da6c2f890cc2cf8ac161c7c8c2074931a4bdb161
Author: Sabri Ünal <libreajans gmail com>
Date:   Sat Oct 19 21:53:25 2019 +0000

    CID 227971: Resource leak
    
    Leaked storage: Variable infile going out of scope leaks the storage it points to
    
    Discovered by Coverity Scan.
    
    (cherry picked from commit 477c9458ab6a49af00a0c1a671c8294bf156a5da)

 plug-ins/common/file-mng.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/plug-ins/common/file-mng.c b/plug-ins/common/file-mng.c
index 63fa72de15..ca9e2d5256 100644
--- a/plug-ins/common/file-mng.c
+++ b/plug-ins/common/file-mng.c
@@ -1476,6 +1476,7 @@ mng_save_image (const gchar  *filename,
                 {
                   g_warning ("Unable to mng_putchunk_ihdr() "
                              "in mng_save_image()");
+                  fclose (infile);
                   goto err3;
                 }
             }
@@ -1486,6 +1487,7 @@ mng_save_image (const gchar  *filename,
                 {
                   g_warning ("Unable to mng_putchunk_idat() "
                              "in mng_save_image()");
+                  fclose (infile);
                   goto err3;
                 }
             }
@@ -1495,6 +1497,7 @@ mng_save_image (const gchar  *filename,
                 {
                   g_warning ("Unable to mng_putchunk_iend() "
                              "in mng_save_image()");
+                  fclose (infile);
                   goto err3;
                 }
             }
@@ -1510,6 +1513,7 @@ mng_save_image (const gchar  *filename,
                 {
                   g_warning ("Unable to mng_putchunk_plte() "
                              "in mng_save_image()");
+                  fclose (infile);
                   goto err3;
                 }
             }
@@ -1521,6 +1525,7 @@ mng_save_image (const gchar  *filename,
                 {
                   g_warning ("Unable to mng_putchunk_trns() "
                              "in mng_save_image()");
+                  fclose (infile);
                   goto err3;
                 }
             }


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