summaryrefslogtreecommitdiff
path: root/src/ini.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-09-07 08:51:26 +0000
committerrubidium <rubidium@openttd.org>2008-09-07 08:51:26 +0000
commitf4ee4fd5aed4861fe65757d2c61ce9510c4a6216 (patch)
tree18224c2b4ae280b93ac7948cfa0938143430bf1f /src/ini.cpp
parent72f86fe801c5a03e3a7d95cf0f7d0ae999ed6931 (diff)
downloadopenttd-f4ee4fd5aed4861fe65757d2c61ce9510c4a6216.tar.xz
(svn r14257) -Fix (r14153): incorrect update of ini-file group tail pointer causing memory corruption.
Diffstat (limited to 'src/ini.cpp')
-rw-r--r--src/ini.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ini.cpp b/src/ini.cpp
index 61ac06289..dc3f452a5 100644
--- a/src/ini.cpp
+++ b/src/ini.cpp
@@ -124,9 +124,10 @@ void IniFile::RemoveGroup(const char *name)
if (prev != NULL) {
prev->next = prev->next->next;
+ if (this->last_group == &group->next) this->last_group = &prev->next;
} else {
this->group = this->group->next;
- prev = this->group;
+ if (this->last_group == &group->next) this->last_group = &this->group;
}
group->next = NULL;