mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-12 10:30:28 +00:00
(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'.
This commit is contained in:
parent
c5a771b59d
commit
73df2c7a25
@ -131,6 +131,13 @@ bool AIInfo::GetSettings()
|
|||||||
return this->engine->CallMethod(*this->SQ_instance, "GetSettings", NULL, -1);
|
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()
|
AIInfo::~AIInfo()
|
||||||
{
|
{
|
||||||
/* Free all allocated strings */
|
/* Free all allocated strings */
|
||||||
|
@ -58,6 +58,7 @@ class AIInfo : public AIFileInfo {
|
|||||||
public:
|
public:
|
||||||
static const char *GetClassName() { return "AIInfo"; }
|
static const char *GetClassName() { return "AIInfo"; }
|
||||||
|
|
||||||
|
AIInfo();
|
||||||
~AIInfo();
|
~AIInfo();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -25,6 +25,7 @@ public:
|
|||||||
description(NULL),
|
description(NULL),
|
||||||
date(NULL),
|
date(NULL),
|
||||||
instance_name(NULL),
|
instance_name(NULL),
|
||||||
|
version(0),
|
||||||
url(NULL)
|
url(NULL)
|
||||||
{}
|
{}
|
||||||
~ScriptFileInfo();
|
~ScriptFileInfo();
|
||||||
|
Loading…
Reference in New Issue
Block a user