mirror of
https://github.com/urbit/shrub.git
synced 2024-12-01 06:35:32 +03:00
avoid use-after-free in raft.c
This commit is contained in:
parent
fb36a1ad5b
commit
4c967b2d60
3
v/raft.c
3
v/raft.c
@ -1684,12 +1684,10 @@ u2_raft_work(u2_reck* rec_u)
|
||||
if ( egg_u == rec_u->ova.geg_u ) {
|
||||
c3_assert(egg_u->nex_u == 0);
|
||||
rec_u->ova.geg_u = rec_u->ova.egg_u = 0;
|
||||
free(egg_u);
|
||||
}
|
||||
else {
|
||||
c3_assert(egg_u->nex_u != 0);
|
||||
rec_u->ova.egg_u = egg_u->nex_u;
|
||||
free(egg_u);
|
||||
}
|
||||
|
||||
if ( u2_yes == egg_u->cit ) {
|
||||
@ -1701,6 +1699,7 @@ u2_raft_work(u2_reck* rec_u)
|
||||
uL(fprintf(uH, "vere: event executed but not persisted\n"));
|
||||
c3_assert(0);
|
||||
}
|
||||
free(egg_u);
|
||||
}
|
||||
else break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user