# HG changeset patch # User tron # Date 1148225230 0 # Node ID 80caa2b88ecff65fbfc2356de38469998dfaf7c4 # Parent e67faccf52f5b5caa5744f5525894755db1c7962 (svn r4942) if (x != NULL) free(x); -> free(x); diff -r e67faccf52f5 -r 80caa2b88ecf ai/ai.c --- a/ai/ai.c Sun May 21 15:19:20 2006 +0000 +++ b/ai/ai.c Sun May 21 15:27:10 2006 +0000 @@ -36,8 +36,7 @@ /* Free item */ entry_com = com->next; - if (com->text != NULL) - free(com->text); + free(com->text); free(com); } } @@ -99,8 +98,7 @@ 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 @@ /* 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; }