Revision: 7404
Author:   ek.kato
Date:     Tue Jan 10 22:55:21 2012
Log:      * uim/uim-custom.c
  - (uim_custom_save_group): Simplify changes in r7322 and r7319.

http://code.google.com/p/uim/source/detail?r=7404

Modified:
 /trunk/uim/uim-custom.c

=======================================
--- /trunk/uim/uim-custom.c     Mon Jan  9 02:38:07 2012
+++ /trunk/uim/uim-custom.c     Tue Jan 10 22:55:21 2012
@@ -1295,8 +1295,10 @@
     goto error;

   custom_syms = uim_custom_collect_by_group(group);
-  if (!custom_syms)
+  if (!custom_syms) {
+    fclose(file);
     goto error;
+  }

   for (sym = custom_syms; *sym; sym++) {
     def_literal = uim_custom_definition_as_literal(*sym);
@@ -1308,11 +1310,8 @@
   }
   uim_custom_symbol_list_free(custom_syms);

-  if (fclose(file) < 0) {
-    file = NULL;
+  if (fclose(file) < 0)
     goto error;
-  }
-  file = NULL;

   /* rename prepared temporary file to proper name */
   file_path = custom_file_path(group, 0);
@@ -1336,9 +1335,6 @@
  error:
   free(tmp_file_path);

-  if (file)
-    fclose(file);
-
   return succeeded;
 }

Reply via email to