diff options
author | rodri <rgl@antares-labs.eu> | 2024-04-03 18:31:40 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2024-04-03 18:31:40 +0000 |
commit | 8b5ba54275a75b71cb5a7c523cf089e4f6ed7fff (patch) | |
tree | 2487da17ea8db86d6cac2cf0bf7e5d5b7fa2e480 | |
parent | d986df6a1511d9b8e80d060e39aa86600e0a281f (diff) | |
download | libgraphics-8b5ba54275a75b71cb5a7c523cf089e4f6ed7fff.tar.gz libgraphics-8b5ba54275a75b71cb5a7c523cf089e4f6ed7fff.tar.bz2 libgraphics-8b5ba54275a75b71cb5a7c523cf089e4f6ed7fff.zip |
scene: correct blatant use-after-free.
-rw-r--r-- | scene.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -201,9 +201,10 @@ delscene(Scene *s) void clearscene(Scene *s) { - Entity *e; + Entity *e, *ne; - for(e = s->ents.next; e != &s->ents; e = e->next){ + for(e = s->ents.next; e != &s->ents; e = ne){ + ne = e->next; s->delent(s, e); delentity(e); } |