From: Keith Packard Date: Sun, 5 Aug 2007 19:31:03 +0000 (-0700) Subject: Free temporary string in FcDirCacheUnlink (Bug #11758) X-Git-Tag: 2.4.91~37 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=3ae9258f9e825ed576dc315ec79009188bb422e2;p=fontconfig.git 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. --- diff --git a/src/fccache.c b/src/fccache.c index 3185059..9e8819c 100644 --- a/src/fccache.c +++ b/src/fccache.c @@ -104,6 +104,7 @@ FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config) if (!cache_hashed) break; (void) unlink ((char *) cache_hashed); + FcStrFree (cache_hashed); } FcStrListDone (list); /* return FcFalse if something went wrong */