]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
CID 134534-134537: Resource leaks in tests/ntpd/t-ntp_signd.c. HStenn.
authorCoverity Build <stenn@ntp.org>
Thu, 3 Dec 2015 09:50:11 +0000 (01:50 -0800)
committerCoverity Build <stenn@ntp.org>
Thu, 3 Dec 2015 09:50:11 +0000 (01:50 -0800)
bk: 56601053R3D-_WYlnVV4n1TWrWSJfg

ChangeLog
tests/ntpd/t-ntp_signd.c

index 43edebf6a926fc4da565dab50b3d099be9f3045b..a2671afca52f3fdf5bcbe321345e62db7226d5ee 100644 (file)
--- 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
index d9c03f48514c5951b5663a5f8bc260fbe5ecb880..aaaec0cb313a5b7bace948bb475cfb8a9aa49cd1 100644 (file)
@@ -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;
 }