diff --git a/src/common/kernel/battle.c b/src/common/kernel/battle.c index 033c0bc50..cb201a280 100644 --- a/src/common/kernel/battle.c +++ b/src/common/kernel/battle.c @@ -289,7 +289,7 @@ message_all(battle * b, message * m) void battlerecord(battle * b, const char *s) { - struct message * m = msg_message("msg_battle", "string", strdup(s)); + struct message * m = msg_message("msg_battle", "string", s); message_all(b, m); msg_release(m); } @@ -303,7 +303,7 @@ battlemsg(battle * b, unit * u, const char * s) watcher * w; sprintf(buf, "%s %s", unitname(u), s); - m = msg_message("msg_battle", "string", strdup(buf)); + m = msg_message("msg_battle", "string", buf); for (bf=b->factions;bf;bf=bf->next) { message_faction(b, bf->faction, m); } @@ -317,7 +317,7 @@ battlemsg(battle * b, unit * u, const char * s) static void fbattlerecord(battle * b, faction * f, const char *s) { - message * m = msg_message("msg_battle", "string", gc_add(strdup(s))); + message * m = msg_message("msg_battle", "string", s); message_faction(b, f, m); msg_release(m); } diff --git a/src/common/modules/gmcmd.c b/src/common/modules/gmcmd.c index e31382a9b..d49018961 100644 --- a/src/common/modules/gmcmd.c +++ b/src/common/modules/gmcmd.c @@ -276,7 +276,7 @@ gm_messageplane(const tnode * tnext, const char * str, void * data, struct order mistake(u, ord, "Unzureichende Rechte für diesen Befehl.\n", 0); } else { - message * msg = msg_message("msg_event", "string", strdup(zmsg)); + message * msg = msg_message("msg_event", "string", zmsg); faction * f; region * r; for (f=factions;f;f=f->next) { @@ -372,10 +372,9 @@ gm_killunit(const tnode * tnext, const char * str, void * data, struct order * o mistake(u, ord, "Unzureichende Rechte für diesen Befehl.\n", 0); } else { - char * zmsg = (char*)gc_add(strdup(msg)); scale_number(target, 0); ADDMSG(&target->faction->msgs, msg_message("killedbygm", - "region unit string", r, target, zmsg)); + "region unit string", r, target, msg)); } } } @@ -445,9 +444,8 @@ gm_messageunit(const tnode * tnext, const char * str, void * data, struct order mistake(u, ord, "Unzureichende Rechte für diesen Befehl.\n", 0); } else { - char * m = (char*)gc_add(strdup(msg)); add_message(&target->faction->msgs, - msg_message("unitmessage", "region unit string", r, u, m)); + msg_message("unitmessage", "region unit string", r, u, msg)); } } }