vere: safely free panc even if not in queue yet

There might be cases where we have created a panc, but have not inserted it
into the linked list yet. Instead of asserting we have inserted it, simply
conditionally update the head of the list.
This commit is contained in:
fang 2022-06-03 00:12:06 +02:00 committed by GitHub
parent 349d567549
commit fd6f24ce04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -188,9 +188,8 @@ _ames_panc_free(u3_panc* pac_u)
if ( 0 != pac_u->pre_u ) {
pac_u->pre_u->nex_u = pac_u->nex_u;
}
else {
c3_assert(pac_u == pac_u->sam_u->pac_u);
pac_u->sam_u->pac_u = pac_u->nex_u;
else if ( pan_u == pan_u->pac_u->sam_u->pan_u ) {
pan_u->pac_u->sam_u->pan_u = pan_u->nex_u;
}
c3_free(pac_u->ptr_v);