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
2 changed files with 3 additions and 5 deletions
|
@ -3479,10 +3479,9 @@ static void free_fighter(fighter * fig)
|
||||||
armor **ap = &fig->armors;
|
armor **ap = &fig->armors;
|
||||||
while (*ap) {
|
while (*ap) {
|
||||||
armor *a = *ap;
|
armor *a = *ap;
|
||||||
ap = &a->next;
|
*ap = a->next;
|
||||||
free(a);
|
free(a);
|
||||||
}
|
}
|
||||||
fig->armors = NULL;
|
|
||||||
while (fig->loot) {
|
while (fig->loot) {
|
||||||
i_free(i_remove(&fig->loot, fig->loot));
|
i_free(i_remove(&fig->loot, fig->loot));
|
||||||
}
|
}
|
||||||
|
@ -3500,7 +3499,7 @@ static void battle_free(battle * b) {
|
||||||
fighter **fp = &s->fighters;
|
fighter **fp = &s->fighters;
|
||||||
while (*fp) {
|
while (*fp) {
|
||||||
fighter *fig = *fp;
|
fighter *fig = *fp;
|
||||||
fp = &fig->next;
|
*fp = fig->next;
|
||||||
free_fighter(fig);
|
free_fighter(fig);
|
||||||
free(fig);
|
free(fig);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1258,10 +1258,9 @@ void free_unit(unit * u)
|
||||||
|
|
||||||
while (*pres) {
|
while (*pres) {
|
||||||
struct reservation *res = *pres;
|
struct reservation *res = *pres;
|
||||||
pres = &res->next;
|
*pres = res->next;
|
||||||
free(res);
|
free(res);
|
||||||
}
|
}
|
||||||
u->reservations = NULL;
|
|
||||||
if (u->skills) {
|
if (u->skills) {
|
||||||
free(u->skills);
|
free(u->skills);
|
||||||
u->skills = NULL;
|
u->skills = NULL;
|
||||||
|
|
Loading…
Reference in a new issue