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:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997 - 1999 Kungliga Tekniska H<>gskolan
|
||||
* Copyright (c) 1997-2000, 2005-2006 Kungliga Tekniska H<>gskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
@@ -53,8 +53,10 @@ kadm5_c_create_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_create);
|
||||
kadm5_store_principal_ent(sp, princ);
|
||||
krb5_store_int32(sp, mask);
|
||||
@@ -66,10 +68,12 @@ kadm5_c_create_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_ret_int32(sp, &tmp);
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_storage_free(sp);
|
||||
krb5_data_free (&reply);
|
||||
return tmp;
|
||||
|
Reference in New Issue
Block a user