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 477c9458ab)
This commit is contained in:
Sabri Ünal 2019-10-19 21:53:25 +00:00 committed by Jehan
parent 6dcdbf652b
commit da6c2f890c
1 changed files with 5 additions and 0 deletions

View File

@ -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;
}
}