summaryrefslogtreecommitdiff
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
commit466e7740d71bb76ed96d3509e8b987e1ed9019bb (patch)
tree18224c2b4ae280b93ac7948cfa0938143430bf1f
parenta42bef612e04a0a78ca8546b866ba3c809c35da3 (diff)
downloadopenttd-466e7740d71bb76ed96d3509e8b987e1ed9019bb.tar.xz
(svn r14257) -Fix (r14153): incorrect update of ini-file group tail pointer causing memory corruption.
-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;