]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Additional fixes for Coverity items
authorDanny Mayer <mayer@ntp.org>
Mon, 20 Mar 2006 03:14:48 +0000 (22:14 -0500)
committerDanny Mayer <mayer@ntp.org>
Mon, 20 Mar 2006 03:14:48 +0000 (22:14 -0500)
bk: 441e1e28rYGLdaVWAxsF61QBnmbJzg

ntpd/ntp_restrict.c
ntpdc/ntpdc.c

index 25047f91645854cf12b9a68cd5abb52c25b7e2cc..04013a1d3eba6c1a47fc62b6d7b952f44d871081 100644 (file)
@@ -527,7 +527,7 @@ hack_restrict(
                                rl6->addr6 = addr6;
                                rl6->mask6 = mask6;
                                rl6->mflags = (u_short)mflags;
-                               if (rlprev6) {
+                               if (rlprev6 != NULL) {
                                        rl6->next = rlprev6->next;
                                        rlprev6->next = rl6;
                                } else {
@@ -569,7 +569,7 @@ hack_restrict(
                        if (rl6 != 0 &&
                            !IN6_IS_ADDR_UNSPECIFIED(&rl6->addr6)
                            && !(rl6->mflags & RESM_INTERFACE)) {
-                               if (rlprev6) {
+                               if (rlprev6 != NULL) {
                                        rlprev6->next = rl6->next;
                                } else {
                                        restrictlist6 = rl6->next;
index c239d1b2987d0a006da12827e4db3bd43d882426..0609cd31bd52842fe8a2b49dc190442facc91ff3 100644 (file)
@@ -472,6 +472,8 @@ openhost(
        }
        if (a_info != 0) {
                (void) fprintf(stderr, "%s\n", gai_strerror(a_info));
+               if (ai != NULL)
+                       freeaddrinfo(ai);
                return 0;
        }
 
@@ -551,7 +553,8 @@ openhost(
                    ai->ai_addrlen) == -1)
 #endif /* SYS_VXWORKS */
            error("connect", "", "");
-       freeaddrinfo(ai);
+       if (ai != NULL)
+               freeaddrinfo(ai);
        havehost = 1;
        req_pkt_size = REQ_LEN_NOMAC;
        impl_ver = IMPL_XNTPD;