Free temporary string in FcDirCacheUnlink (Bug #11758)

In FcDirCacheUnlink(), the line

  cache_hashed = FcStrPlus (cache_dir, cache_base);

allocates memory in cache_hashed that is never free()'d before the function
exits.

Reported by Ben Combee.
This commit is contained in:
Keith Packard 2007-08-05 12:31:03 -07:00
parent c80a08d6bf
commit 3ae9258f9e
1 changed files with 1 additions and 0 deletions

View File

@ -104,6 +104,7 @@ FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config)
if (!cache_hashed) if (!cache_hashed)
break; break;
(void) unlink ((char *) cache_hashed); (void) unlink ((char *) cache_hashed);
FcStrFree (cache_hashed);
} }
FcStrListDone (list); FcStrListDone (list);
/* return FcFalse if something went wrong */ /* return FcFalse if something went wrong */