summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-11-22 21:45:28 +0000
committerrubidium <rubidium@openttd.org>2013-11-22 21:45:28 +0000
commit33626064011336529c2bda2a1b4d702c635d0564 (patch)
treeea8b0b897a03d432587da46591242870c017f19a
parent83a76c73c7b79650e46361f4576d7709c3a771b0 (diff)
downloadopenttd-33626064011336529c2bda2a1b4d702c635d0564.tar.xz
(svn r26053) -Fix: possible use-after-free
-rw-r--r--src/newgrf_gui.cpp2
1 files changed, 2 insertions, 0 deletions
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;