Fix a dereference of a null pointer
When exiting from for loop by not satisfying the condition of `(s = next[i])` at FcCacheRemoveUnlocked() referring s->alloated will be invalid.
This commit is contained in:
parent
3a45b8ef65
commit
b047e29954
|
@ -710,6 +710,8 @@ FcCacheRemoveUnlocked (FcCache *cache)
|
|||
while (fcCacheMaxLevel > 0 && fcCacheChains[fcCacheMaxLevel - 1] == NULL)
|
||||
fcCacheMaxLevel--;
|
||||
|
||||
if (s)
|
||||
{
|
||||
allocated = s->allocated;
|
||||
while (allocated)
|
||||
{
|
||||
|
@ -720,6 +722,7 @@ FcCacheRemoveUnlocked (FcCache *cache)
|
|||
}
|
||||
free (s);
|
||||
}
|
||||
}
|
||||
|
||||
static FcCache *
|
||||
FcCacheFindByStat (struct stat *cache_stat)
|
||||
|
|
Loading…
Reference in New Issue