From: Coverity Build Date: Thu, 3 Dec 2015 09:50:11 +0000 (-0800) Subject: CID 134534-134537: Resource leaks in tests/ntpd/t-ntp_signd.c. HStenn. X-Git-Tag: NTP_4_3_86~3^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73b92827305fe1fb2e682850b5591c00c27ba51e;p=thirdparty%2Fntp.git CID 134534-134537: Resource leaks in tests/ntpd/t-ntp_signd.c. HStenn. bk: 56601053R3D-_WYlnVV4n1TWrWSJfg --- diff --git a/ChangeLog b/ChangeLog index 43edebf6a..a2671afca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,10 @@ * [Sec 2956] small-step/big-step. Close the panic gate earlier. HStenn. * CID 1339955: Free allocated memory in caljulian test. HStenn. * CID 1339962: Explicitly initialize variable in caljulian test. HStenn. +* CID 1341534: Resource leak in tests/ntpd/t-ntp_signd.c. HStenn. +* CID 1341535: Resource leak in tests/ntpd/t-ntp_signd.c. HStenn. +* CID 1341536: Resource leak in tests/ntpd/t-ntp_signd.c. HStenn. +* CID 1341537: Resource leak in tests/ntpd/t-ntp_signd.c. HStenn. * CID 1341538: Memory leak in tests/ntpd/ntp_prio_q.c:262. HStenn. * [Bug 2829] Look at pipe_fds in ntpd.c (did so. perlinger@ntp.org) * [Bug 2887] stratum -1 config results as showing value 99 diff --git a/tests/ntpd/t-ntp_signd.c b/tests/ntpd/t-ntp_signd.c index d9c03f485..aaaec0cb3 100644 --- a/tests/ntpd/t-ntp_signd.c +++ b/tests/ntpd/t-ntp_signd.c @@ -110,6 +110,7 @@ test_write_all(void) int temp = write_all(fd, str,strlen(str)); TEST_ASSERT_EQUAL(strlen(str), temp); + (void)close(fd); return; } @@ -118,11 +119,15 @@ void test_send_packet(void) { int fd = ux_socket_connect("/socket"); + + TEST_ASSERT_TRUE(isGE(fd, 0)); + char * str2 = "PACKET12345"; int temp = send_packet(fd, str2, strlen(str2)); TEST_ASSERT_EQUAL(0,temp); + (void)close(fd); return; } @@ -135,6 +140,9 @@ void test_recv_packet(void) { int fd = ux_socket_connect("/socket"); + + TEST_ASSERT_TRUE(isGE(fd, 0)); + uint32_t size = 256; char *str = NULL; int temp = recv_packet(fd, &str, &size); @@ -143,6 +151,7 @@ test_recv_packet(void) free(str); TEST_ASSERT_EQUAL(0,temp); //0 because nobody sent us anything (yet!) + (void)close(fd); return; }