AXIS2_EXTERN rp_signed_encrypted_elements_t *AXIS2_CALL rp_signed_encrypted_elements_create( const axutil_env_t * env) { rp_signed_encrypted_elements_t *signed_encrypted_elements = NULL; AXIS2_ENV_CHECK(env, NULL); signed_encrypted_elements = (rp_signed_encrypted_elements_t *)AXIS2_MALLOC(env->allocator, sizeof(rp_signed_encrypted_elements_t)); if(signed_encrypted_elements == NULL) { AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); return NULL; } signed_encrypted_elements->xpath_expressions = NULL; signed_encrypted_elements->xpath_expressions = axutil_array_list_create(env, 0); if(!(signed_encrypted_elements->xpath_expressions)) { rp_signed_encrypted_elements_free(signed_encrypted_elements, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); return NULL; } signed_encrypted_elements->xpath_version = NULL; signed_encrypted_elements->ref = 0; return signed_encrypted_elements; }
AXIS2_EXTERN void AXIS2_CALL rp_supporting_tokens_free( rp_supporting_tokens_t * supporting_tokens, const axutil_env_t * env) { AXIS2_ENV_CHECK(env, AXIS2_FAILURE); if (supporting_tokens) { if (--(supporting_tokens->ref) > 0) { return; } if (supporting_tokens->tokens) { int i = 0; for (i = 0; i < axutil_array_list_size(supporting_tokens->tokens, env); i++) { rp_property_t *token = NULL; token = (rp_property_t *) axutil_array_list_get(supporting_tokens->tokens, env, i); if (token) rp_property_free(token, env); token = NULL; } axutil_array_list_free(supporting_tokens->tokens, env); supporting_tokens->tokens = NULL; } if (supporting_tokens->algorithmsuite) { rp_algorithmsuite_free(supporting_tokens->algorithmsuite, env); supporting_tokens->algorithmsuite = NULL; } if (supporting_tokens->signed_parts) { rp_signed_encrypted_parts_free(supporting_tokens->signed_parts, env); supporting_tokens->signed_parts = NULL; } if (supporting_tokens->signed_elements) { rp_signed_encrypted_elements_free(supporting_tokens-> signed_elements, env); supporting_tokens->signed_elements = NULL; } if (supporting_tokens->encrypted_parts) { rp_signed_encrypted_parts_free(supporting_tokens->encrypted_parts, env); supporting_tokens->encrypted_parts = NULL; } if (supporting_tokens->encrypted_elements) { rp_signed_encrypted_elements_free(supporting_tokens-> encrypted_elements, env); supporting_tokens->encrypted_elements = NULL; } AXIS2_FREE(env->allocator, supporting_tokens); supporting_tokens = NULL; } return; }