2002-03-13 Ken Raeburn <raeburn@mit.edu>
* kcmd.c (kcmd_connect): Don't call fixup_addrinfo, it's been
- deleted.
+ deleted. Actually save errno value when preparing error text to
+ print. Free address info before returning.
2002-03-08 Ken Raeburn <raeburn@mit.edu>
*host_save = malloc(strlen(ap->ai_canonname) + 1);
if (*host_save == NULL) {
fprintf(stderr, "kcmd: no memory\n");
+ freeaddrinfo(ap);
return -1;
}
strcpy(*host_save, ap->ai_canonname);
(*lportp)--;
}
+ oerrno = errno;
aierr = getnameinfo(ap->ai_addr, ap->ai_addrlen,
hostbuf, sizeof(hostbuf), 0, 0, NI_NUMERICHOST);
if (aierr)
if (ap->ai_next)
fprintf(stderr, "Trying next address...\n");
}
+ freeaddrinfo(ap2);
return -1;
connected:
*sp = s;
*sockinp = *(struct sockaddr_in *) ap->ai_addr;
+ freeaddrinfo(ap2);
return 0;
}