Commit b047e299 authored by Akira TAGOH's avatar Akira TAGOH

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.
parent 3a45b8ef
Pipeline #10932 passed with stage
in 5 minutes and 43 seconds
......@@ -710,15 +710,18 @@ FcCacheRemoveUnlocked (FcCache *cache)
while (fcCacheMaxLevel > 0 && fcCacheChains[fcCacheMaxLevel - 1] == NULL)
fcCacheMaxLevel--;
allocated = s->allocated;
while (allocated)
if (s)
{
/* First element in allocated chunk is the free list */
next = *(void **)allocated;
free (allocated);
allocated = next;
allocated = s->allocated;
while (allocated)
{
/* First element in allocated chunk is the free list */
next = *(void **)allocated;
free (allocated);
allocated = next;
}
free (s);
}
free (s);
}
static FcCache *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment