(krb5_get_init_creds_password): kludge around `ret_as_reply' semantics
by only freeing it when ret == 0 git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5901 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -455,7 +455,7 @@ krb5_get_init_creds_password(krb5_context context,
|
|||||||
password = buf;
|
password = buf;
|
||||||
break;
|
break;
|
||||||
case KRB5KDC_ERR_PREAUTH_REQUIRED : {
|
case KRB5KDC_ERR_PREAUTH_REQUIRED : {
|
||||||
if(kdc_reply.error.e_data){
|
if(kdc_reply.error.e_data) {
|
||||||
METHOD_DATA md;
|
METHOD_DATA md;
|
||||||
int i;
|
int i;
|
||||||
decode_METHOD_DATA(kdc_reply.error.e_data->data,
|
decode_METHOD_DATA(kdc_reply.error.e_data->data,
|
||||||
@@ -488,7 +488,7 @@ krb5_get_init_creds_password(krb5_context context,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
free_METHOD_DATA(&md);
|
free_METHOD_DATA(&md);
|
||||||
}else{
|
} else {
|
||||||
if (pre_auth_types)
|
if (pre_auth_types)
|
||||||
free (pre_auth_types);
|
free (pre_auth_types);
|
||||||
pre_auth_types = malloc(2 * sizeof(*pre_auth_types));
|
pre_auth_types = malloc(2 * sizeof(*pre_auth_types));
|
||||||
@@ -513,6 +513,7 @@ krb5_get_init_creds_password(krb5_context context,
|
|||||||
data);
|
data);
|
||||||
out:
|
out:
|
||||||
memset (buf, 0, sizeof(buf));
|
memset (buf, 0, sizeof(buf));
|
||||||
|
if (ret == 0)
|
||||||
krb5_free_kdc_rep (context, &kdc_reply);
|
krb5_free_kdc_rep (context, &kdc_reply);
|
||||||
|
|
||||||
free (pre_auth_types);
|
free (pre_auth_types);
|
||||||
|
Reference in New Issue
Block a user