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:
		@@ -53,7 +53,7 @@ kadm5_c_modify_principal(void *server_handle,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    sp = krb5_storage_from_mem(buf, sizeof(buf));
 | 
					    sp = krb5_storage_from_mem(buf, sizeof(buf));
 | 
				
			||||||
    if (sp == NULL) {
 | 
					    if (sp == NULL) {
 | 
				
			||||||
	krb5_clear_error_string(context->contect);
 | 
						krb5_clear_error_string(context->context);
 | 
				
			||||||
	return ENOMEM;
 | 
						return ENOMEM;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    krb5_store_int32(sp, kadm_modify);
 | 
					    krb5_store_int32(sp, kadm_modify);
 | 
				
			||||||
@@ -68,12 +68,12 @@ kadm5_c_modify_principal(void *server_handle,
 | 
				
			|||||||
	return ret;
 | 
						return ret;
 | 
				
			||||||
    sp = krb5_storage_from_data (&reply);
 | 
					    sp = krb5_storage_from_data (&reply);
 | 
				
			||||||
    if (sp == NULL) {
 | 
					    if (sp == NULL) {
 | 
				
			||||||
	krb5_clear_error_string(context->contect);
 | 
						krb5_clear_error_string(context->context);
 | 
				
			||||||
	krb5_data_free (&reply);
 | 
						krb5_data_free (&reply);
 | 
				
			||||||
	return ENOMEM;
 | 
						return ENOMEM;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    krb5_ret_int32(sp, &tmp);
 | 
					    krb5_ret_int32(sp, &tmp);
 | 
				
			||||||
    krb5_clear_error_string(context->contect);
 | 
					    krb5_clear_error_string(context->context);
 | 
				
			||||||
    krb5_storage_free(sp);
 | 
					    krb5_storage_free(sp);
 | 
				
			||||||
    krb5_data_free (&reply);
 | 
					    krb5_data_free (&reply);
 | 
				
			||||||
    return tmp;
 | 
					    return tmp;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -50,8 +50,10 @@ kadm5_c_get_privs(void *server_handle, u_int32_t *privs)
 | 
				
			|||||||
	return ret;
 | 
						return ret;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    sp = krb5_storage_from_mem(buf, sizeof(buf));
 | 
					    sp = krb5_storage_from_mem(buf, sizeof(buf));
 | 
				
			||||||
    if (sp == NULL)
 | 
					    if (sp == NULL) {
 | 
				
			||||||
 | 
						krb5_clear_error_string(context->context);
 | 
				
			||||||
	return ENOMEM;
 | 
						return ENOMEM;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    krb5_store_int32(sp, kadm_get_privs);
 | 
					    krb5_store_int32(sp, kadm_get_privs);
 | 
				
			||||||
    ret = _kadm5_client_send(context, sp);
 | 
					    ret = _kadm5_client_send(context, sp);
 | 
				
			||||||
    krb5_storage_free(sp);
 | 
					    krb5_storage_free(sp);
 | 
				
			||||||
@@ -62,10 +64,12 @@ kadm5_c_get_privs(void *server_handle, u_int32_t *privs)
 | 
				
			|||||||
	return ret;
 | 
						return ret;
 | 
				
			||||||
    sp = krb5_storage_from_data(&reply);
 | 
					    sp = krb5_storage_from_data(&reply);
 | 
				
			||||||
    if (sp == NULL) {
 | 
					    if (sp == NULL) {
 | 
				
			||||||
 | 
						krb5_clear_error_string(context->context);
 | 
				
			||||||
	krb5_data_free (&reply);
 | 
						krb5_data_free (&reply);
 | 
				
			||||||
	return ENOMEM;
 | 
						return ENOMEM;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    krb5_ret_int32(sp, &tmp);
 | 
					    krb5_ret_int32(sp, &tmp);
 | 
				
			||||||
 | 
					    krb5_clear_error_string(context->context);
 | 
				
			||||||
    ret = tmp;
 | 
					    ret = tmp;
 | 
				
			||||||
    if(ret == 0){
 | 
					    if(ret == 0){
 | 
				
			||||||
	krb5_ret_int32(sp, &tmp);
 | 
						krb5_ret_int32(sp, &tmp);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -53,8 +53,10 @@ kadm5_c_randkey_principal(void *server_handle,
 | 
				
			|||||||
	return ret;
 | 
						return ret;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    sp = krb5_storage_from_mem(buf, sizeof(buf));
 | 
					    sp = krb5_storage_from_mem(buf, sizeof(buf));
 | 
				
			||||||
    if (sp == NULL)
 | 
					    if (sp == NULL) {
 | 
				
			||||||
 | 
						krb5_clear_error_string(context->context);
 | 
				
			||||||
	return ENOMEM;
 | 
						return ENOMEM;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    krb5_store_int32(sp, kadm_randkey);
 | 
					    krb5_store_int32(sp, kadm_randkey);
 | 
				
			||||||
    krb5_store_principal(sp, princ);
 | 
					    krb5_store_principal(sp, princ);
 | 
				
			||||||
    ret = _kadm5_client_send(context, sp);
 | 
					    ret = _kadm5_client_send(context, sp);
 | 
				
			||||||
@@ -66,9 +68,11 @@ kadm5_c_randkey_principal(void *server_handle,
 | 
				
			|||||||
	return ret;
 | 
						return ret;
 | 
				
			||||||
    sp = krb5_storage_from_data(&reply);
 | 
					    sp = krb5_storage_from_data(&reply);
 | 
				
			||||||
    if (sp == NULL) {
 | 
					    if (sp == NULL) {
 | 
				
			||||||
 | 
						krb5_clear_error_string(context->context);
 | 
				
			||||||
	krb5_data_free (&reply);
 | 
						krb5_data_free (&reply);
 | 
				
			||||||
	return ENOMEM;
 | 
						return ENOMEM;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    krb5_clear_error_string(context->context);
 | 
				
			||||||
    krb5_ret_int32(sp, &tmp);
 | 
					    krb5_ret_int32(sp, &tmp);
 | 
				
			||||||
    ret = tmp;
 | 
					    ret = tmp;
 | 
				
			||||||
    if(ret == 0){
 | 
					    if(ret == 0){
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user