Date: Wed, 4 May 2016 07:39:24 +0000 (UTC) From: Garrett Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299059 - stable/10/contrib/netbsd-tests/lib/libc/sys Message-ID: <201605040739.u447dO12080810@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Wed May 4 07:39:23 2016 New Revision: 299059 URL: https://svnweb.freebsd.org/changeset/base/299059 Log: MFC r298366: Fix coverity issues with contrib/netbsd-tests/lib/libc/sys/t_connect.c - Ensure socket(2) calls succeed - Don't leak slist allocated by earlier socket(2) call CID: 976773, 1251405 Modified: stable/10/contrib/netbsd-tests/lib/libc/sys/t_connect.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libc/sys/t_connect.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/sys/t_connect.c Wed May 4 07:37:02 2016 (r299058) +++ stable/10/contrib/netbsd-tests/lib/libc/sys/t_connect.c Wed May 4 07:39:23 2016 (r299059) @@ -56,6 +56,11 @@ ATF_TC_BODY(connect_low_port, tc) slist = socket(AF_INET, SOCK_STREAM, 0); sd = socket(AF_INET, SOCK_STREAM, 0); +#ifdef __FreeBSD__ + ATF_REQUIRE(sd > 0); + ATF_REQUIRE(slist > 0); +#endif + /* bind listening socket */ memset(&sinlist, 0, sizeof(sinlist)); sinlist.sin_family = AF_INET; @@ -92,6 +97,9 @@ ATF_TC_BODY(connect_low_port, tc) ATF_REQUIRE(ntohs(sin.sin_port) <= IPPORT_RESERVEDMAX); close(sd); +#ifdef __FreeBSD__ + close(slist); +#endif } ATF_TP_ADD_TCS(tp)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605040739.u447dO12080810>