]> git.wh0rd.org - fontconfig.git/commitdiff
Free temporary string in FcDirCacheUnlink (Bug #11758)
authorKeith Packard <keithp@neko.keithp.com>
Sun, 5 Aug 2007 19:31:03 +0000 (12:31 -0700)
committerKeith Packard <keithp@neko.keithp.com>
Sun, 5 Aug 2007 19:31:03 +0000 (12:31 -0700)
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.

src/fccache.c

index 3185059c4f229246d5bb38652606f6417e7205a9..9e8819cbdc2d111d833353e329e18d635e74e31e 100644 (file)
@@ -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 */