[gtksourceview/gnome-3-24] language: fix Coverity defect
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/gnome-3-24] language: fix Coverity defect
- Date: Sun, 22 Jan 2017 12:04:14 +0000 (UTC)
commit 9ba7056c63e6ff465c5859c88e2ee0edf73728bb
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sun Jan 22 11:44:43 2017 +0100
language: fix Coverity defect
In practice, I'm not sure that fd can be leaked in that code path, but
in theory it can happen, so handle the case.
gtksourceview/gtksourcelanguage.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gtksourceview/gtksourcelanguage.c b/gtksourceview/gtksourcelanguage.c
index 2497910..4ee8147 100644
--- a/gtksourceview/gtksourcelanguage.c
+++ b/gtksourceview/gtksourcelanguage.c
@@ -124,8 +124,12 @@ _gtk_source_language_new_from_file (const gchar *filename,
}
else
{
- g_warning("Unable to open '%s'", filename);
+ g_warning ("Unable to open '%s'", filename);
+ if (fd != -1)
+ {
+ close (fd);
+ }
}
if (lang != NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]