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,11 +136,13 @@ 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
|
||||
to use */
|
||||
|
|
Loading…
Reference in New Issue