Changeset - r3886:8d33dd6a91c5
[Not reviewed]
master
0 1 0
tron - 18 years ago 2006-05-21 15:27:10
tron@openttd.org
(svn r4942) if (x != NULL) free(x); -> free(x);
1 file changed with 3 insertions and 7 deletions:
ai/ai.c
3
7
0 comments (0 inline, 0 general)
ai/ai.c
Show inline comments
 
@@ -36,8 +36,7 @@ static void AI_DequeueCommands(PlayerID 
 

	
 
		/* Free item */
 
		entry_com = com->next;
 
		if (com->text != NULL)
 
			free(com->text);
 
		free(com->text);
 
		free(com);
 
	}
 
}
 
@@ -99,8 +98,7 @@ int32 AI_DoCommand(uint tile, uint32 p1,
 
	res = DoCommand(tile, p1, p2, flags & ~DC_EXEC, procc);
 
	/* The command failed, or you didn't want to execute, or you are quering, return */
 
	if ((CmdFailed(res)) || !(flags & DC_EXEC) || (flags & DC_QUERY_COST)) {
 
		if (tmp_cmdtext != NULL)
 
			free(tmp_cmdtext);
 
		free(tmp_cmdtext);
 
		return res;
 
	}
 

	
 
@@ -132,9 +130,7 @@ int32 AI_DoCommand(uint tile, uint32 p1,
 
	/* Set _local_player back */
 
	_local_player = old_lp;
 

	
 
	/* Free the temp _cmd_text var */
 
	if (tmp_cmdtext != NULL)
 
		free(tmp_cmdtext);
 
	free(tmp_cmdtext);
 

	
 
	return res;
 
}
0 comments (0 inline, 0 general)