Clear error-string when introducing new errors.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16662 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-01-25 12:53:09 +00:00
parent dbc39600e2
commit e38a8ac78d
3 changed files with 13 additions and 5 deletions

View File

@@ -53,8 +53,10 @@ kadm5_c_randkey_principal(void *server_handle,
return ret;
sp = krb5_storage_from_mem(buf, sizeof(buf));
if (sp == NULL)
if (sp == NULL) {
krb5_clear_error_string(context->context);
return ENOMEM;
}
krb5_store_int32(sp, kadm_randkey);
krb5_store_principal(sp, princ);
ret = _kadm5_client_send(context, sp);
@@ -66,9 +68,11 @@ kadm5_c_randkey_principal(void *server_handle,
return ret;
sp = krb5_storage_from_data(&reply);
if (sp == NULL) {
krb5_clear_error_string(context->context);
krb5_data_free (&reply);
return ENOMEM;
}
krb5_clear_error_string(context->context);
krb5_ret_int32(sp, &tmp);
ret = tmp;
if(ret == 0){