(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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user