From f215603a10308051e3877fcd5c1688597c227553 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@justemail.net>
Date: Wed, 14 May 2014 09:44:19 +0000
Subject: [PATCH] Closing the libmagic file after use.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4881 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 ChangeLog   | 1 +
 src/color.c | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 3ce987da..d666499a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
 	two-column characters properly.  This fixes Savannah bug #31743.
 	* src/nano.c (precalc_multicolorinfo): Improve debugging messages,
 	and remove superfluous assignment (fileptr already equals endptr).
+	* src/color.c (color_update): Close the libmagic file after use.
 
 2014-05-13  Benno Schulenberg  <bensberg@justemail.net>
 	* src/text.c (do_linter): Make an error message somewhat clearer.
diff --git a/src/color.c b/src/color.c
index d2fcfe47..7a53b35d 100644
--- a/src/color.c
+++ b/src/color.c
@@ -201,8 +201,9 @@ void color_update(void)
 		statusbar(_("magic_file(%s) failed: %s"),
 				openfile->filename, magic_error(cookie));
 	    }
+	    magic_close(cookie);
 #ifdef DEBUG
-	fprintf(stderr, "Returned magic string is: %s\n", magicstring);
+	    fprintf(stderr, "Returned magic string is: %s\n", magicstring);
 #endif
 	}
     }
-- 
GitLab