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:
Enrico Weigelt, metux IT consult 2025-05-08 16:55:00 +02:00
parent 5193f57aae
commit a7f8d0db3d

View File

@ -136,10 +136,12 @@ static void
DestroyFragments(struct xorg_list *frags)
{
FragmentList *it, *tmp;
if (!xorg_list_is_empty(frags)) {
xorg_list_for_each_entry_safe(it, tmp, frags, l) {
xorg_list_del(&it->l);
free(it);
}
}
}
/** @brief Constructs a context record for ConstructClientId* functions