[gimp] CID: 228176 Fix a Resource leak
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] CID: 228176 Fix a Resource leak
- Date: Wed, 23 Oct 2019 12:43:07 +0000 (UTC)
commit 0b81e4d056767500bad1070eb62f96d25e7d483a
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.
(cherry picked from commit 3d7d46ea97c8c1614b689858d6e5540b529fa53d)
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 e9bbe362c8..335612d1e2 100644
--- a/plug-ins/file-sgi/sgi.c
+++ b/plug-ins/file-sgi/sgi.c
@@ -324,6 +324,7 @@ load_image (GFile *file,
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
_("Could not open '%s' for reading."),
gimp_file_get_utf8_name (file));
+ free (sgip);
return NULL;
};
@@ -338,6 +339,7 @@ load_image (GFile *file,
{
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
_("Invalid width: %hu"), sgip->xsize);
+ free (sgip);
return NULL;
}
@@ -345,6 +347,7 @@ load_image (GFile *file,
{
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
_("Invalid height: %hu"), sgip->ysize);
+ free (sgip);
return NULL;
}
@@ -352,6 +355,7 @@ load_image (GFile *file,
{
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
_("Invalid number of channels: %hu"), sgip->zsize);
+ free (sgip);
return NULL;
}
@@ -392,6 +396,7 @@ load_image (GFile *file,
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
"Could not allocate new image: %s",
gimp_pdb_get_last_error (gimp_get_pdb ()));
+ free (sgip);
return NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]