summaryrefslogtreecommitdiff
path: root/src/ai/ai_info.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-12-06 20:22:21 +0000
committerrubidium <rubidium@openttd.org>2009-12-06 20:22:21 +0000
commit73df2c7a252eb8c523222928de3d5ed98d78519b (patch)
tree78206cbbe81fa95054d28245d91ae37f0875ba36 /src/ai/ai_info.cpp
parentc5a771b59d8edaf577fbc093b0fbe98421ed8804 (diff)
downloadopenttd-73df2c7a252eb8c523222928de3d5ed98d78519b.tar.xz
(svn r18418) -Fix [FS#3298]: under some circumstances a pointer could be left untouched and then freed. Make sure this doesn't happen by ensuring it starts out as NULL instead of 'garbage'.
Diffstat (limited to 'src/ai/ai_info.cpp')
-rw-r--r--src/ai/ai_info.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ai/ai_info.cpp b/src/ai/ai_info.cpp
index d6337d511..be16a4966 100644
--- a/src/ai/ai_info.cpp
+++ b/src/ai/ai_info.cpp
@@ -131,6 +131,13 @@ bool AIInfo::GetSettings()
return this->engine->CallMethod(*this->SQ_instance, "GetSettings", NULL, -1);
}
+AIInfo::AIInfo() :
+ min_loadable_version(0),
+ use_as_random(false),
+ api_version(NULL)
+{
+}
+
AIInfo::~AIInfo()
{
/* Free all allocated strings */