changeset 35360:a3e8af09792d

Close the skin file after reading.
author ib
date Fri, 23 Nov 2012 10:31:07 +0000
parents 4bdb1cc07953
children 3e8dcfa3ceef
files gui/skin/skin.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/gui/skin/skin.c	Fri Nov 23 10:24:10 2012 +0000
+++ b/gui/skin/skin.c	Fri Nov 23 10:31:07 2012 +0000
@@ -1074,19 +1074,23 @@
 
         for (i = 0; i < FF_ARRAY_ELEMS(skinItem); i++) {
             if (!strcmp(item, skinItem[i].name)) {
-                if (skinItem[i].func(param) != 0)
+                if (skinItem[i].func(param) != 0) {
+                    fclose(skinfile);
                     return -2;
-                else
+                } else
                     break;
             }
         }
 
         if (i == FF_ARRAY_ELEMS(skinItem)) {
             skin_error(MSGTR_SKIN_UNKNOWN_ITEM, item);
+            fclose(skinfile);
             return -2;
         }
     }
 
+    fclose(skinfile);
+
     if (linenumber == 0) {
         mp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_SKIN_SkinFileNotReadable, skinfname);
         return -1;