Date: Wed, 17 Dec 2014 20:19:58 +0000 (UTC) From: Michael Tuexen <tuexen@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275868 - head/sys/netinet6 Message-ID: <201412172019.sBHKJwTL083006@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tuexen Date: Wed Dec 17 20:19:57 2014 New Revision: 275868 URL: https://svnweb.freebsd.org/changeset/base/275868 Log: Plug a memory leak in an error code path. Reported by: Coverity CID: 1018936 MFC after: 3 days Modified: head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Wed Dec 17 20:02:07 2014 (r275867) +++ head/sys/netinet6/sctp6_usrreq.c Wed Dec 17 20:19:57 2014 (r275868) @@ -1125,8 +1125,11 @@ sctp6_peeraddr(struct socket *so, struct SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ENOENT); return (ENOENT); } - if ((error = sa6_recoverscope(sin6)) != 0) + if ((error = sa6_recoverscope(sin6)) != 0) { + SCTP_FREE_SONAME(sin6); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, error); return (error); + } *addr = (struct sockaddr *)sin6; return (0); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412172019.sBHKJwTL083006>