int
main(int argc, char *argv[])
{
- struct addrinfo *ap, aihints;
+ struct addrinfo *ap, aihints, *apstart;
int aierr;
int sock;
krb5_context context;
}
/* set up the address of the foreign socket for connect() */
+ apstart = ap; /* For freeing later */
for (sock = -1; ap && sock == -1; ap = ap->ai_next) {
char abuf[NI_MAXHOST], pbuf[NI_MAXSERV];
char mbuf[NI_MAXHOST + NI_MAXSERV + 64];
com_err(argv[0], 0, "no error or reply from sendauth!");
exit(1);
}
+ freeaddrinfo(apstart);
krb5_free_context(context);
exit(0);
}
syslog(LOG_ERR, "%m: while writing data to client");
exit(1);
}
+
+ krb5_free_ticket(context, ticket);
+ if(keytab)
+ krb5_kt_close(context, keytab);
+ krb5_free_principal(context, server);
krb5_auth_con_free(context, auth_context);
krb5_free_context(context);
exit(0);