Changeset - r21377:3dc48b232a46
[Not reviewed]
master
0 1 0
rubidium - 10 years ago 2014-04-20 16:43:22
rubidium@openttd.org
(svn r26476) -Fix: prevent comparing to NULL when strndup could not allocate memory
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/ini_load.cpp
Show inline comments
 
@@ -63,7 +63,8 @@ IniGroup::IniGroup(IniLoadFile *parent, 
 
	if (len == 0) len = strlen(name);
 

	
 
	this->name = strndup(name, len);
 
	if (this->name != NULL) str_validate(this->name, this->name + len);
 
	if (this->name == NULL) error("not enough memory to allocate group name");
 
	str_validate(this->name, this->name + len);
 

	
 
	this->last_item = &this->item;
 
	*parent->last_group = this;
0 comments (0 inline, 0 general)