[Bug 1273] CID 10: Palisade leaks unit struct in error path.
[Bug 1274] CID 67: ensure resolve_hosts() output count and pointers
are consistent.
[Bug 1275] CID 45: CID 46: old sntp uses uninitialized guesses[0],
precs[0].
bk: 4a6fcc81YCfkVsqQErbUm7HWzRPmuw
+* [Bug 1272] gsoc_sntp IPv6 build problems under HP-UX 10.
+* [Bug 1273] CID 10: Palisade leaks unit struct in error path.
+* [Bug 1274] CID 67: ensure resolve_hosts() output count and pointers
+ are consistent.
+* [Bug 1275] CID 45: CID 46: old sntp uses uninitialized guesses[0],
+ precs[0].
(4.2.5p195) 2009/07/27 Released by Harlan Stenn <stenn@ntp.org>
* cvo.sh: Add support for CentOS, Fedora, Slackware, SuSE.
(4.2.5p194) 2009/07/26 Released by Harlan Stenn <stenn@ntp.org>
char adr_buf[INET6_ADDRSTRLEN];
-/* resolve_hosts consumes an arry of hostnames/addresses and its length, stores a pointer
+/* resolve_hosts consumes an array of hostnames/addresses and its length, stores a pointer
* to the array with the resolved hosts in res and returns the size of the array res.
* pref_family enforces IPv4 or IPv6 depending on commandline options and system
* capability. If pref_family is NULL or PF_UNSPEC any compatible family will be accepted.
}
}
- /* Make a list of the addrinfo list entries, start by counting them */
- *res = realloc(tres, sizeof(struct addrinfo *) * resc);
+ if (resc)
+ *res = realloc(tres, sizeof(struct addrinfo *) * resc);
+ else {
+ free(tres);
+ *res = NULL;
+ }
return resc;
}
}
}
}
+#ifdef ISC_PLATFORM_HAVEIPV6
else if (IS_IPV6(sas)) {
struct ipv6_mreq mdevadr;
}
}
}
+#endif /* ISC_PLATFORM_HAVEIPV6 */
FD_ZERO(&bcst_fd);
FD_SET(rsock, &bcst_fd);
if (IS_IPV4(sas))
setsockopt(rsock, IPPROTO_IP, IP_DROP_MEMBERSHIP, &btrue, sizeof(btrue));
+#ifdef ISC_PLATFORM_HAVEIPV6
else if (IS_IPV6(sas))
setsockopt(rsock, IPPROTO_IPV6, IPV6_LEAVE_GROUP, &btrue, sizeof(btrue));
+#endif
return recv_bytes;
}
DPRINTF(4, ("set SO_REUSEADDR to %s on %s\n",
on ? "on" : "off",
- stoa(any)));
+ stoa(&any->sin)));
}
}
#endif /* OS_NEEDS_REUSEADDR_FOR_IFADDRBIND */
#ifdef DEBUG
printf("Palisade(%d) tcgetattr(fd, &tio)\n",unit);
#endif
+ close(fd);
return (0);
}
*/
up = (struct palisade_unit *) emalloc(sizeof(struct palisade_unit));
- if (!(up)) {
- msyslog(LOG_ERR, "Palisade(%d) emalloc: %m",unit);
-#ifdef DEBUG
- printf("Palisade(%d) emalloc\n",unit);
-#endif
- (void) close(fd);
- return (0);
- }
-
memset((char *)up, 0, sizeof(struct palisade_unit));
up->type = CLK_TYPE(peer);
#ifdef DEBUG
printf("Palisade(%d) tcsetattr(fd, &tio)\n",unit);
#endif
+ close(fd);
+ free(up);
return 0;
}
ntp_data data;
char text[100];
+ guesses[0] = 0;
+ precs[0] = 0;
+
if (verbose > 2) {
format_time(text,50,0.0,-1.0,0.0,-1.0,-10);
fprintf(stderr,"Started=%.6f %s\n",current_time(JAN_1970),text);