Fix a double free of an SCTP association in an error path.

This is joint work with rrs@. The issue was found by running
syzkaller.

MFC after:		1 week
This commit is contained in:
Michael Tuexen 2019-03-26 08:27:00 +00:00
parent ad48359a65
commit eb3b9ea3fe
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=345525

View File

@ -1481,8 +1481,6 @@ sctp_do_connect_x(struct socket *so, struct sctp_inpcb *inp, void *optval,
sctp_connectx_helper_add(stcb, sa, (totaddr - 1), &error);
/* Fill in the return id */
if (error) {
(void)sctp_free_assoc(inp, stcb, SCTP_PCBFREE_FORCE,
SCTP_FROM_SCTP_USRREQ + SCTP_LOC_7);
goto out_now;
}
a_id = (sctp_assoc_t *)optval;