From 33626064011336529c2bda2a1b4d702c635d0564 Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 22 Nov 2013 21:45:28 +0000 Subject: (svn r26053) -Fix: possible use-after-free --- src/newgrf_gui.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 3250ead8d..61c6b678c 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -991,6 +991,8 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { if (newsel == NULL && c->next == this->active_sel) newsel = c; if (c == this->active_sel) { + if (newsel == c) newsel = NULL; + *pc = c->next; delete c; break; -- cgit v1.2.3-70-g09d2