(krb5_sock_to_principal): copy hname before calling

krb5_sname_to_principal.  from "Jacques A. Vidrine" <n@nectar.com>


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10298 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
2001-07-09 14:40:35 +00:00
parent ec7ff9ef1d
commit f055cc84f7

View File

@@ -82,9 +82,16 @@ krb5_sock_to_principal (krb5_context context,
}
}
return krb5_sname_to_principal (context,
hname,
sname,
type,
ret_princ);
hname = strdup(hname);
if (hname == NULL) {
krb5_set_error_string (context, "malloc: out of memory");
return ENOMEM;
}
ret = krb5_sname_to_principal (context,
hname,
sname,
type,
ret_princ);
free(hname);
return ret;
}