In aname_replacer(), initialize current, null it when transferring
ownership to the caller, and free it on cleanup. Otherwise it leaks
on failure. Reported by Bean Zhang.
ticket: 8698
{
krb5_error_code ret = 0;
const char *cp, *ep, *tp;
- char *current, *newstr, *rule = NULL, *repl = NULL;
+ char *newstr, *rule = NULL, *repl = NULL, *current = NULL;
krb5_boolean doglobal;
*result = NULL;
current = newstr;
}
*result = current;
+ current = NULL;
cleanup:
+ free(current);
free(repl);
free(rule);
return ret;