Fix a use-after-free in an error case.

PR: 255872
Submitted by:  lylgood
Differential Revision:  https://reviews.freebsd.org/D30454
This commit is contained in:
Takanori Watanabe 2021-05-26 18:23:33 +09:00
parent 399bad7b9a
commit 14803ec8d1

View File

@ -528,6 +528,7 @@ static int le_connection_complete(ng_hci_unit_p unit, struct mbuf *event)
if (error != 0) {
ng_hci_con_untimeout(con);
ng_hci_free_con(con);
goto out;
}
} else if ((error = ng_hci_con_untimeout(con)) != 0)