Xext: xres: protect against free()ing from non-heap
> ../Xext/xres.c: In function ‘DestroyFragments’: > ../Xext/xres.c:124:9: warning: ‘free’ of ‘it’ which points to memory on the stack [CWE-590] [-Wanalyzer-free-of-non-heap] > 124 | free(it); > | ^~~~~~~~ Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
5193f57aae
commit
a7f8d0db3d
|
@ -136,9 +136,11 @@ static void
|
||||||
DestroyFragments(struct xorg_list *frags)
|
DestroyFragments(struct xorg_list *frags)
|
||||||
{
|
{
|
||||||
FragmentList *it, *tmp;
|
FragmentList *it, *tmp;
|
||||||
xorg_list_for_each_entry_safe(it, tmp, frags, l) {
|
if (!xorg_list_is_empty(frags)) {
|
||||||
xorg_list_del(&it->l);
|
xorg_list_for_each_entry_safe(it, tmp, frags, l) {
|
||||||
free(it);
|
xorg_list_del(&it->l);
|
||||||
|
free(it);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue