(krb5_get_in_tkt_with_keytab): avoid memory leak that snuck in when
krb5_keytab_key_proc was exported, pointed out by Panases Inc git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13197 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -79,16 +79,10 @@ krb5_get_in_tkt_with_keytab (krb5_context context,
|
|||||||
krb5_creds *creds,
|
krb5_creds *creds,
|
||||||
krb5_kdc_rep *ret_as_reply)
|
krb5_kdc_rep *ret_as_reply)
|
||||||
{
|
{
|
||||||
krb5_keytab_key_proc_args *a;
|
krb5_keytab_key_proc_args a;
|
||||||
|
|
||||||
a = malloc(sizeof(*a));
|
a.principal = creds->client;
|
||||||
if (a == NULL) {
|
a.keytab = keytab;
|
||||||
krb5_set_error_string(context, "malloc: out of memory");
|
|
||||||
return ENOMEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
a->principal = creds->client;
|
|
||||||
a->keytab = keytab;
|
|
||||||
|
|
||||||
return krb5_get_in_tkt (context,
|
return krb5_get_in_tkt (context,
|
||||||
options,
|
options,
|
||||||
@@ -96,7 +90,7 @@ krb5_get_in_tkt_with_keytab (krb5_context context,
|
|||||||
etypes,
|
etypes,
|
||||||
pre_auth_types,
|
pre_auth_types,
|
||||||
krb5_keytab_key_proc,
|
krb5_keytab_key_proc,
|
||||||
a,
|
&a,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
creds,
|
creds,
|
||||||
|
Reference in New Issue
Block a user