Skip to content

Commit

Permalink
Don't leak an address in an error path.
Browse files Browse the repository at this point in the history
CID:		1351729
MFC after:	3 days
  • Loading branch information
tuexen committed Feb 23, 2016
1 parent ef01940 commit 63d9199
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sys/netinet6/sctp6_usrreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,7 @@ sctp6_getaddr(struct socket *so, struct sockaddr **addr)
stcb = LIST_FIRST(&inp->sctp_asoc_list);
if (stcb == NULL) {
SCTP_INP_RUNLOCK(inp);
SCTP_FREE_SONAME(sin6);
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ENOENT);
return (ENOENT);
}
Expand All @@ -1028,6 +1029,7 @@ sctp6_getaddr(struct socket *so, struct sockaddr **addr)
if ((!fnd) || (sin_a6 == NULL)) {
/* punt */
SCTP_INP_RUNLOCK(inp);
SCTP_FREE_SONAME(sin6);
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ENOENT);
return (ENOENT);
}
Expand Down

0 comments on commit 63d9199

Please sign in to comment.