correctly (they can modify their arguments).
+2005-10-31 Patrick Lam <plam@mit.edu>
+ * fc-cat/fc-cat.c (FcCacheFileRead, main):
+ * src/fcfreetype.c (FcFreeTypeQuery):
+
+ Fix small memory error (tried to free argv); use basename and
+ dirname correctly (they can modify their arguments).
+
2005-10-31 Patrick Lam <plam@mit.edu>
* fc-cat/fc-cat.c:
* src/fccache.c:
goto bail1;
close(fd);
- free (cache_file);
return FcTrue;
bail1:
close (fd);
bail:
- free (cache_file);
return FcFalse;
}
i = 1;
#endif
- if (FcCacheFileRead (fs, dirs, dirname (argv[i]), argv[i]))
+ if (FcCacheFileRead (fs, dirs, dirname (strdup(argv[i])), argv[i]))
FcCachePrintSet (fs, dirs, argv[i]);
FcStrSetDestroy (dirs);
printf ("Saving unique fullname %s\n", full);
}
- if (!FcPatternAddString (pat, FC_FILE, (FcChar8 *)basename((char *)file)))
+ if (!FcPatternAddString (pat, FC_FILE, (FcChar8 *)basename((char *)FcStrCopy(file))))
goto bail1;
FcPatternAddFullFname (pat, (const char *)file);