Fix the memory leak in fc-cat

This commit is contained in:
Akira TAGOH 2014-08-12 18:53:04 +09:00
parent 23e88d8c6a
commit eb2689c67b
1 changed files with 2 additions and 6 deletions

View File

@ -316,12 +316,6 @@ main (int argc, char **argv)
return 1; return 1;
} }
} }
arglist = FcStrListCreate (args);
if (!arglist)
{
fprintf (stderr, "%s: malloc failure\n", argv[0]);
return 1;
}
} }
else else
{ {
@ -341,6 +335,7 @@ main (int argc, char **argv)
fprintf (stderr, "%s: malloc failure\n", argv[0]); fprintf (stderr, "%s: malloc failure\n", argv[0]);
return 1; return 1;
} }
FcStrSetDestroy (args);
while ((arg = FcStrListNext (arglist))) while ((arg = FcStrListNext (arglist)))
{ {
@ -385,6 +380,7 @@ main (int argc, char **argv)
if (cache_file) if (cache_file)
FcStrFree (cache_file); FcStrFree (cache_file);
} }
FcStrListDone (arglist);
FcFini (); FcFini ();
return 0; return 0;