Clear error-string when introducing new errors.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16661 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-01-25 12:50:10 +00:00
parent 740309eb47
commit dbc39600e2
5 changed files with 29 additions and 11 deletions

View File

@@ -50,8 +50,10 @@ kadm5_c_delete_principal(void *server_handle, krb5_principal princ)
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_delete);
krb5_store_principal(sp, princ);
ret = _kadm5_client_send(context, sp);
@@ -63,10 +65,12 @@ kadm5_c_delete_principal(void *server_handle, krb5_principal princ)
return ret;
sp = krb5_storage_from_data (&reply);
if(sp == NULL) {
krb5_clear_error_string(context->context);
krb5_data_free (&reply);
return ENOMEM;
}
krb5_ret_int32(sp, &tmp);
krb5_clear_error_string(context->context);
krb5_storage_free(sp);
krb5_data_free (&reply);
return tmp;