Date: Mon, 24 Aug 2020 15:52:46 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r364696 - stable/12/sys/compat/linux Message-ID: <202008241552.07OFqka7054932@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Mon Aug 24 15:52:45 2020 New Revision: 364696 URL: https://svnweb.freebsd.org/changeset/base/364696 Log: MFC r348056 by dchagin: Do not leak sa in linux_recvfrom() call if kern_recvit() fails. Modified: stable/12/sys/compat/linux/linux_socket.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linux/linux_socket.c ============================================================================== --- stable/12/sys/compat/linux/linux_socket.c Mon Aug 24 15:50:57 2020 (r364695) +++ stable/12/sys/compat/linux/linux_socket.c Mon Aug 24 15:52:45 2020 (r364696) @@ -915,7 +915,7 @@ linux_recvfrom(struct thread *td, struct linux_recvfro error = kern_recvit(td, args->s, &msg, UIO_SYSSPACE, NULL); if (error != 0) - return (error); + goto out; if (PTRIN(args->from) != NULL) { error = bsd_to_linux_sockaddr(sa, &lsa, msg.msg_namelen); @@ -928,7 +928,7 @@ linux_recvfrom(struct thread *td, struct linux_recvfro if (error == 0 && PTRIN(args->fromlen) != NULL) error = copyout(&msg.msg_namelen, PTRIN(args->fromlen), sizeof(msg.msg_namelen)); - +out: free(sa, M_SONAME); return (error); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008241552.07OFqka7054932>