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,15 +710,18 @@ FcCacheRemoveUnlocked (FcCache *cache)
|
||||||
while (fcCacheMaxLevel > 0 && fcCacheChains[fcCacheMaxLevel - 1] == NULL)
|
while (fcCacheMaxLevel > 0 && fcCacheChains[fcCacheMaxLevel - 1] == NULL)
|
||||||
fcCacheMaxLevel--;
|
fcCacheMaxLevel--;
|
||||||
|
|
||||||
allocated = s->allocated;
|
if (s)
|
||||||
while (allocated)
|
|
||||||
{
|
{
|
||||||
/* First element in allocated chunk is the free list */
|
allocated = s->allocated;
|
||||||
next = *(void **)allocated;
|
while (allocated)
|
||||||
free (allocated);
|
{
|
||||||
allocated = next;
|
/* First element in allocated chunk is the free list */
|
||||||
|
next = *(void **)allocated;
|
||||||
|
free (allocated);
|
||||||
|
allocated = next;
|
||||||
|
}
|
||||||
|
free (s);
|
||||||
}
|
}
|
||||||
free (s);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static FcCache *
|
static FcCache *
|
||||||
|
|
Loading…
Reference in New Issue