more memory leaks fixed

This commit is contained in:
Enno Rehling 2006-01-02 22:29:07 +00:00
parent bde330b131
commit c5585a3520
4 changed files with 6 additions and 4 deletions

View file

@ -1522,8 +1522,8 @@ split_allocations(region * r)
msg_message("produce_lowskill", "unit region resource", msg_message("produce_lowskill", "unit region resource",
al->unit, al->unit->region, rtype)); al->unit, al->unit->region, rtype));
} else { } else {
add_message(&al->unit->faction->msgs, ADDMSG(&al->unit->faction->msgs, msg_message("produce",
msg_message("produce", "unit region amount wanted resource", "unit region amount wanted resource",
al->unit, al->unit->region, al->get, al->want, rtype)); al->unit, al->unit->region, al->get, al->want, rtype));
} }
*p_al=al->next; *p_al=al->next;

View file

@ -362,7 +362,7 @@ mistake(const unit * u, struct order * ord, const char *comment, int mtype)
if (u->faction->no != MONSTER_FACTION) { if (u->faction->no != MONSTER_FACTION) {
char * cmt = strdup(comment); char * cmt = strdup(comment);
ADDMSG(&u->faction->msgs, msg_message("mistake", ADDMSG(&u->faction->msgs, msg_message("mistake",
"command error unit region", copy_order(ord), cmt, u, u->region)); "command error unit region", ord, cmt, u, u->region));
} }
} }

View file

@ -1431,7 +1431,7 @@ travel_route(unit * u, region_list * route_begin, region_list * route_end, order
} }
if (mode!=TRAVEL_TRANSPORTED) { if (mode!=TRAVEL_TRANSPORTED) {
ADDMSG(&u->faction->msgs, msg_message("travel", ADDMSG(&u->faction->msgs, msg_message("travel",
"unit mode start end regions", u, walkmode, r, current, strdup(buf))); "unit mode start end regions", u, walkmode, r, current, buf));
} }
mark_travelthru(u, r, route_begin, iroute); mark_travelthru(u, r, route_begin, iroute);

View file

@ -1102,12 +1102,14 @@ readunit(FILE * F)
if (!is_persistent(ord) || ++p<MAXPERSISTENT) { if (!is_persistent(ord) || ++p<MAXPERSISTENT) {
*orderp = ord; *orderp = ord;
orderp = &ord->next; orderp = &ord->next;
ord = NULL;
} else if (p==MAXPERSISTENT) { } else if (p==MAXPERSISTENT) {
log_error(("%s had %d or more persistent orders\n", unitname(u), MAXPERSISTENT)); log_error(("%s had %d or more persistent orders\n", unitname(u), MAXPERSISTENT));
} }
} else if (n==MAXORDERS) { } else if (n==MAXORDERS) {
log_error(("%s had %d or more orders\n", unitname(u), MAXORDERS)); log_error(("%s had %d or more orders\n", unitname(u), MAXORDERS));
} }
if (ord!=NULL) free_order(ord);
} }
freadstr(F, buf, sizeof(buf)); freadstr(F, buf, sizeof(buf));
} }