]> git.wh0rd.org Git - fontconfig.git/commitdiff
Correctly handle mmap() failure (#21062)
authorSerge van den Boom <svdb+freedesktop.org@stack.nl>
Sun, 5 Apr 2009 23:00:18 +0000 (19:00 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Wed, 24 Jun 2009 17:52:10 +0000 (13:52 -0400)
src/fccache.c

index 63319f61d7fed895056b95b2be3b85e47645611d..69e1a6b82166532df55dff1957fb58901d5b9a1c 100644 (file)
@@ -553,6 +553,8 @@ FcDirCacheMapFd (int fd, struct stat *fd_stat, struct stat *dir_stat)
     {
 #if defined(HAVE_MMAP) || defined(__CYGWIN__)
        cache = mmap (0, fd_stat->st_size, PROT_READ, MAP_SHARED, fd, 0);
+       if (cache == MAP_FAILED)
+           cache = NULL;
 #elif defined(_WIN32)
        {
            HANDLE hFileMap;