Fix free of uninitialized memory in error case introduced in 1.10
development cycle.
ticket: 7036
tags: pullup
Target_Version: 1.10
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25498
dc483132-0cff-0310-8789-
dd5450dbe970
/* copy the hostname into non-volatile storage */
if (type == KRB5_NT_SRV_HST) {
- struct addrinfo *ai, hints;
+ struct addrinfo *ai = NULL, hints;
int err;
char hnamebuf[NI_MAXHOST];
}
remote_host = strdup((ai && ai->ai_canonname) ? ai->ai_canonname : hostname);
if (!remote_host) {
- freeaddrinfo(ai);
+ if(ai)
+ freeaddrinfo(ai);
return ENOMEM;
}