]> git.wh0rd.org - fontconfig.git/commitdiff
Fix embarassing attempt to free a static buffer.
authorPatrick Lam <plam@MIT.EDU>
Thu, 1 Sep 2005 06:59:44 +0000 (06:59 +0000)
committerPatrick Lam <plam@MIT.EDU>
Thu, 1 Sep 2005 06:59:44 +0000 (06:59 +0000)
src/fccache.c

index efc1cf0342615324b7d70894cea67930494ee9b0..ce4f49d28907effa97d1f81e3b0c129694e147f9 100644 (file)
@@ -201,7 +201,6 @@ FcGlobalCacheLoad (FcGlobalCache    *cache,
     }
     cache->dirs = 0;
  bail0:
-    free (current_arch_machine_name);
     close (cache->fd);
     cache->fd = -1;
     return;
@@ -735,11 +734,11 @@ FcDirCacheWrite (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir)
        current_arch_start = FcCacheNextOffset (lseek(fd, 0, SEEK_END));
 
     if (!FcCacheMoveDown(fd, current_arch_start))
-       goto bail2;
+       goto bail1;
 
     current_arch_start = lseek(fd, 0, SEEK_CUR);
     if (ftruncate (fd, current_arch_start) == -1)
-       goto bail2;
+       goto bail1;
 
     /* now write the address of the next offset */
     truncate_to = FcCacheNextOffset (FcCacheNextOffset (current_arch_start + sizeof (FcCache)) + metadata.count) - current_arch_start;
@@ -767,10 +766,8 @@ FcDirCacheWrite (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir)
     close(fd);
     return FcTrue;
 
- bail2:
-    free (header);
  bail1:
-    free (current_arch_machine_name);
+    free (header);
  bail0:
     free (current_dir_block);
  bail: