forked from github/server
F*ck this MSVC message:
warning C6001: Using uninitialized memory It is confused, and I screwed up trying to work around it.
This commit is contained in:
parent
aa466f3cc8
commit
4403552b61
|
@ -3479,10 +3479,9 @@ static void free_fighter(fighter * fig)
|
|||
armor **ap = &fig->armors;
|
||||
while (*ap) {
|
||||
armor *a = *ap;
|
||||
ap = &a->next;
|
||||
*ap = a->next;
|
||||
free(a);
|
||||
}
|
||||
fig->armors = NULL;
|
||||
while (fig->loot) {
|
||||
i_free(i_remove(&fig->loot, fig->loot));
|
||||
}
|
||||
|
@ -3500,7 +3499,7 @@ static void battle_free(battle * b) {
|
|||
fighter **fp = &s->fighters;
|
||||
while (*fp) {
|
||||
fighter *fig = *fp;
|
||||
fp = &fig->next;
|
||||
*fp = fig->next;
|
||||
free_fighter(fig);
|
||||
free(fig);
|
||||
}
|
||||
|
|
|
@ -1258,10 +1258,9 @@ void free_unit(unit * u)
|
|||
|
||||
while (*pres) {
|
||||
struct reservation *res = *pres;
|
||||
pres = &res->next;
|
||||
*pres = res->next;
|
||||
free(res);
|
||||
}
|
||||
u->reservations = NULL;
|
||||
if (u->skills) {
|
||||
free(u->skills);
|
||||
u->skills = NULL;
|
||||
|
|
Loading…
Reference in New Issue