+Sat Feb 3 22:37:55 1996 Mark Eichin <eichin@cygnus.com>
+
+ * network.c (add_port): sunos realloc doesn't handle a NULL
+ pointer, so protect with a macro.
+
Sat Feb 10 02:46:27 1996 Mark Eichin <eichin@cygnus.com>
* main.c (initialize_realms): look for [kdc] profile=path for
static fd_set select_fds;
static int select_nfds;
+#define safe_realloc(p,n) ((p)?(realloc(p,n)):(malloc(n)))
+
static krb5_error_code add_port(port)
u_short port;
{
if (n_udp_ports >= max_udp_ports) {
new_max = max_udp_ports + 10;
- new_fds = realloc(udp_port_fds, new_max * sizeof(int));
+ new_fds = safe_realloc(udp_port_fds, new_max * sizeof(int));
if (new_fds == 0)
return ENOMEM;
udp_port_fds = new_fds;
- new_ports = realloc(udp_port_nums, new_max * sizeof(u_short));
+ new_ports = safe_realloc(udp_port_nums, new_max * sizeof(u_short));
if (new_ports == 0)
return ENOMEM;
udp_port_nums = new_ports;
udp_port_nums[n_udp_ports++] = port;
return 0;
}
-
+#undef safe_realloc
krb5_error_code
setup_network(prog)