diff --git a/ChangeLog b/ChangeLog
index 3ce987daab0ad0591d5f9f1cbf21b160c63c5308..d666499aad835daf8fb439eca0f0777d4432b352 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 d2fcfe47040b1f7163029aa4dd831b526f1f4bd9..7a53b35d6abd53ca8d3698c08133c60bde95a2c5 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
 	}
     }