Imported Upstream version 2.11.93
[platform/upstream/fontconfig.git] / fc-cat / fc-cat.c
index 72912b7..f0131b6 100644 (file)
@@ -67,17 +67,15 @@ extern int optind, opterr, optopt;
 #endif
 
 /*
- * POSIX has broken stdio so that getc must do thread-safe locking,
+ * POSIX has broken stdio so that putc must do thread-safe locking,
  * this is a serious performance problem for applications doing large
- * amounts of IO with getc (as is done here).  If available, use
- * the getc_unlocked varient instead.
+ * amounts of IO with putc (as is done here).  If available, use
+ * the putc_unlocked varient instead.
  */
  
-#if defined(getc_unlocked) || defined(_IO_getc_unlocked)
-#define GETC(f) getc_unlocked(f)
+#if defined(putc_unlocked) || defined(_IO_putc_unlocked)
 #define PUTC(c,f) putc_unlocked(c,f)
 #else
-#define GETC(f) getc(f)
 #define PUTC(c,f) putc(c,f)
 #endif
 
@@ -300,6 +298,7 @@ main (int argc, char **argv)
        return 1;
     }
     FcConfigSetCurrent (config);
+    FcConfigDestroy (config);
     
     args = FcStrSetCreate ();
     if (!args)
@@ -317,12 +316,6 @@ main (int argc, char **argv)
                return 1;
            }
        }
-       arglist = FcStrListCreate (args);
-       if (!arglist)
-       {
-           fprintf (stderr, "%s: malloc failure\n", argv[0]);
-           return 1;
-       }
     }
     else
     {
@@ -342,6 +335,7 @@ main (int argc, char **argv)
        fprintf (stderr, "%s: malloc failure\n", argv[0]);
        return 1;
     }
+    FcStrSetDestroy (args);
 
     while ((arg = FcStrListNext (arglist)))
     {
@@ -386,6 +380,7 @@ main (int argc, char **argv)
        if (cache_file)
            FcStrFree (cache_file);
     }
+    FcStrListDone (arglist);
 
     FcFini ();
     return 0;