diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/soap/TODO | 1 | ||||
-rw-r--r-- | ext/soap/php_encoding.c | 15 | ||||
-rw-r--r-- | ext/soap/php_encoding.h | 1 | ||||
-rw-r--r-- | ext/soap/php_schema.c | 302 | ||||
-rw-r--r-- | ext/soap/php_sdl.c | 233 | ||||
-rw-r--r-- | ext/soap/php_sdl.h | 12 | ||||
-rw-r--r-- | ext/soap/php_soap.h | 1 | ||||
-rw-r--r-- | ext/soap/soap.c | 14 |
8 files changed, 264 insertions, 315 deletions
diff --git a/ext/soap/TODO b/ext/soap/TODO index a0ce0d2078..96f2a740b9 100644 --- a/ext/soap/TODO +++ b/ext/soap/TODO @@ -3,7 +3,6 @@ General - make sure soapserver.map(), soap_encode_to_xml() and soap_encode_to_zval() are really need - reimplement SoapObject::__getfunctions() and SoapObject::__gettypes() to return structures instead of strings -? memory leaks (libxml and WSDL/Schema use malloc to cache WSDL) - error handling??? SOAP diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 43146d9191..d4d5367e7d 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -2609,21 +2609,6 @@ void delete_encoder(void *encode) { encodePtr t = *((encodePtr*)encode); if (t->details.ns) { - sdl_free(t->details.ns); - } - if (t->details.type_str) { - sdl_free(t->details.type_str); - } - if (t->details.map) { - delete_mapping(t->details.map); - } - sdl_free(t); -} - -void delete_tmp_encoder(void *encode) -{ - encodePtr t = *((encodePtr*)encode); - if (t->details.ns) { efree(t->details.ns); } if (t->details.type_str) { diff --git a/ext/soap/php_encoding.h b/ext/soap/php_encoding.h index f00ea77bc9..47069d1020 100644 --- a/ext/soap/php_encoding.h +++ b/ext/soap/php_encoding.h @@ -215,7 +215,6 @@ encodePtr get_conversion_from_type_ex(HashTable *encoding, xmlNodePtr node, cons encodePtr get_conversion_from_href_type_ex(HashTable *encoding, const char *type, int len); void delete_encoder(void *handle); -void delete_tmp_encoder(void *encode); extern encode defaultEncoding[]; diff --git a/ext/soap/php_schema.c b/ext/soap/php_schema.c index db97fbfa3f..b4e21eb002 100644 --- a/ext/soap/php_schema.c +++ b/ext/soap/php_schema.c @@ -52,8 +52,8 @@ static encodePtr create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const char *ns, encodePtr enc, *enc_ptr; if (sdl->encoders == NULL) { - sdl->encoders = sdl_malloc(sizeof(HashTable)); - zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, SDL_PERSISTENT); + sdl->encoders = emalloc(sizeof(HashTable)); + zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, 0); } smart_str_appends(&nscat, ns); smart_str_appendc(&nscat, ':'); @@ -62,19 +62,19 @@ static encodePtr create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const char *ns, if (zend_hash_find(sdl->encoders, nscat.c, nscat.len + 1, (void**)&enc_ptr) == SUCCESS) { enc = *enc_ptr; if (enc->details.ns) { - sdl_free(enc->details.ns); + efree(enc->details.ns); } if (enc->details.type_str) { - sdl_free(enc->details.type_str); + efree(enc->details.type_str); } } else { enc_ptr = NULL; - enc = sdl_malloc(sizeof(encode)); + enc = emalloc(sizeof(encode)); } memset(enc, 0, sizeof(encode)); - enc->details.ns = sdl_strdup(ns); - enc->details.type_str = sdl_strdup(type); + enc->details.ns = estrdup(ns); + enc->details.type_str = estrdup(type); enc->details.sdl_type = cur_type; enc->to_xml = sdl_guess_convert_xml; enc->to_zval = sdl_guess_convert_zval; @@ -178,8 +178,8 @@ int load_schema(sdlCtx *ctx,xmlNodePtr schema) xmlAttrPtr tns; if (!ctx->sdl->types) { - ctx->sdl->types = sdl_malloc(sizeof(HashTable)); - zend_hash_init(ctx->sdl->types, 0, NULL, delete_type, SDL_PERSISTENT); + ctx->sdl->types = emalloc(sizeof(HashTable)); + zend_hash_init(ctx->sdl->types, 0, NULL, delete_type, 0); } if (!ctx->attributes) { ctx->attributes = emalloc(sizeof(HashTable)); @@ -321,27 +321,27 @@ static int schema_simpleType(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr simpleType, /* Anonymous type inside <element> or <restriction> */ sdlTypePtr newType, *ptr; - newType = sdl_malloc(sizeof(sdlType)); + newType = emalloc(sizeof(sdlType)); memset(newType, 0, sizeof(sdlType)); newType->kind = XSD_TYPEKIND_SIMPLE; if (name != NULL) { - newType->name = sdl_strdup(name->children->content); - newType->namens = sdl_strdup(ns->children->content); + newType->name = estrdup(name->children->content); + newType->namens = estrdup(ns->children->content); } else { - newType->name = sdl_strdup(cur_type->name); - newType->namens = sdl_strdup(cur_type->namens); + newType->name = estrdup(cur_type->name); + newType->namens = estrdup(cur_type->namens); } zend_hash_next_index_insert(sdl->types, &newType, sizeof(sdlTypePtr), (void **)&ptr); if (sdl->encoders == NULL) { - sdl->encoders = sdl_malloc(sizeof(HashTable)); - zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, SDL_PERSISTENT); + sdl->encoders = emalloc(sizeof(HashTable)); + zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, 0); } - cur_type->encode = sdl_malloc(sizeof(encode)); + cur_type->encode = emalloc(sizeof(encode)); memset(cur_type->encode, 0, sizeof(encode)); - cur_type->encode->details.ns = sdl_strdup(newType->namens); - cur_type->encode->details.type_str = sdl_strdup(newType->name); + cur_type->encode->details.ns = estrdup(newType->namens); + cur_type->encode->details.type_str = estrdup(newType->name); cur_type->encode->details.sdl_type = *ptr; cur_type->encode->to_xml = sdl_guess_convert_xml; cur_type->encode->to_zval = sdl_guess_convert_zval; @@ -352,18 +352,18 @@ static int schema_simpleType(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr simpleType, } else if (name != NULL) { sdlTypePtr newType, *ptr; - newType = sdl_malloc(sizeof(sdlType)); + newType = emalloc(sizeof(sdlType)); memset(newType, 0, sizeof(sdlType)); newType->kind = XSD_TYPEKIND_SIMPLE; - newType->name = sdl_strdup(name->children->content); - newType->namens = sdl_strdup(ns->children->content); + newType->name = estrdup(name->children->content); + newType->namens = estrdup(ns->children->content); if (cur_type == NULL) { zend_hash_next_index_insert(sdl->types, &newType, sizeof(sdlTypePtr), (void **)&ptr); } else { if (cur_type->elements == NULL) { - cur_type->elements = sdl_malloc(sizeof(HashTable)); - zend_hash_init(cur_type->elements, 0, NULL, delete_type, SDL_PERSISTENT); + cur_type->elements = emalloc(sizeof(HashTable)); + zend_hash_init(cur_type->elements, 0, NULL, delete_type, 0); } zend_hash_update(cur_type->elements, newType->name, strlen(newType->name)+1, &newType, sizeof(sdlTypePtr), (void **)&ptr); } @@ -427,17 +427,17 @@ static int schema_list(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr listType, sdlTypeP if (nsptr != NULL) { sdlTypePtr newType, *tmp; - newType = sdl_malloc(sizeof(sdlType)); + newType = emalloc(sizeof(sdlType)); memset(newType, 0, sizeof(sdlType)); - newType->name = sdl_strdup(type); - newType->namens = sdl_strdup(nsptr->href); + newType->name = estrdup(type); + newType->namens = estrdup(nsptr->href); newType->encode = get_create_encoder(sdl, newType, (char *)nsptr->href, type); if (cur_type->elements == NULL) { - cur_type->elements = sdl_malloc(sizeof(HashTable)); - zend_hash_init(cur_type->elements, 0, NULL, delete_type, SDL_PERSISTENT); + cur_type->elements = emalloc(sizeof(HashTable)); + zend_hash_init(cur_type->elements, 0, NULL, delete_type, 0); } zend_hash_next_index_insert(cur_type->elements, &newType, sizeof(sdlTypePtr), (void **)&tmp); } @@ -457,15 +457,15 @@ static int schema_list(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr listType, sdlTypeP php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: element has both 'itemType' attribute and subtype"); } - newType = sdl_malloc(sizeof(sdlType)); + newType = emalloc(sizeof(sdlType)); memset(newType, 0, sizeof(sdlType)); - newType->name = sdl_strdup("anonymous"); - newType->namens = sdl_strdup(tsn->children->content); + newType->name = estrdup("anonymous"); + newType->namens = estrdup(tsn->children->content); if (cur_type->elements == NULL) { - cur_type->elements = sdl_malloc(sizeof(HashTable)); - zend_hash_init(cur_type->elements, 0, NULL, delete_type, SDL_PERSISTENT); + cur_type->elements = emalloc(sizeof(HashTable)); + zend_hash_init(cur_type->elements, 0, NULL, delete_type, 0); } zend_hash_next_index_insert(cur_type->elements, &newType, sizeof(sdlTypePtr), (void **)&tmp); @@ -514,17 +514,17 @@ static int schema_union(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr unionType, sdlTyp if (nsptr != NULL) { sdlTypePtr newType, *tmp; - newType = sdl_malloc(sizeof(sdlType)); + newType = emalloc(sizeof(sdlType)); memset(newType, 0, sizeof(sdlType)); - newType->name = sdl_strdup(type); - newType->namens = sdl_strdup(nsptr->href); + newType->name = estrdup(type); + newType->namens = estrdup(nsptr->href); newType->encode = get_create_encoder(sdl, newType, (char *)nsptr->href, type); if (cur_type->elements == NULL) { - cur_type->elements = sdl_malloc(sizeof(HashTable)); - zend_hash_init(cur_type->elements, 0, NULL, delete_type, SDL_PERSISTENT); + cur_type->elements = emalloc(sizeof(HashTable)); + zend_hash_init(cur_type->elements, 0, NULL, delete_type, 0); } zend_hash_next_index_insert(cur_type->elements, &newType, sizeof(sdlTypePtr), (void **)&tmp); } @@ -549,15 +549,15 @@ static int schema_union(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr unionType, sdlTyp php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: union has both 'memberTypes' attribute and subtypes"); } - newType = sdl_malloc(sizeof(sdlType)); + newType = emalloc(sizeof(sdlType)); memset(newType, 0, sizeof(sdlType)); - newType->name = sdl_strdup("anonymous"); - newType->namens = sdl_strdup(tsn->children->content); + newType->name = estrdup("anonymous"); + newType->namens = estrdup(tsn->children->content); if (cur_type->elements == NULL) { - cur_type->elements = sdl_malloc(sizeof(HashTable)); - zend_hash_init(cur_type->elements, 0, NULL, delete_type, SDL_PERSISTENT); + cur_type->elements = emalloc(sizeof(HashTable)); + zend_hash_init(cur_type->elements, 0, NULL, delete_type, 0); } zend_hash_next_index_insert(cur_type->elements, &newType, sizeof(sdlTypePtr), (void **)&tmp); @@ -648,7 +648,7 @@ static int schema_restriction_simpleContent(sdlPtr sdl, xmlAttrPtr tsn, xmlNodeP } if (cur_type->restrictions == NULL) { - cur_type->restrictions = sdl_malloc(sizeof(sdlRestrictions)); + cur_type->restrictions = emalloc(sizeof(sdlRestrictions)); memset(cur_type->restrictions, 0, sizeof(sdlRestrictions)); } @@ -689,8 +689,8 @@ static int schema_restriction_simpleContent(sdlPtr sdl, xmlAttrPtr tsn, xmlNodeP schema_restriction_var_char(trav, &enumval); if (cur_type->restrictions->enumeration == NULL) { - cur_type->restrictions->enumeration = sdl_malloc(sizeof(HashTable)); - zend_hash_init(cur_type->restrictions->enumeration, 0, NULL, delete_restriction_var_char, SDL_PERSISTENT); + cur_type->restrictions->enumeration = emalloc(sizeof(HashTable)); + zend_hash_init(cur_type->restrictions->enumeration, 0, NULL, delete_restriction_var_char, 0); } zend_hash_add(cur_type->restrictions->enumeration, enumval->value, strlen(enumval->value)+1, &enumval, sizeof(sdlRestrictionCharPtr), NULL); } else { @@ -796,7 +796,7 @@ static int schema_restriction_var_int(xmlNodePtr val, sdlRestrictionIntPtr *valp xmlAttrPtr fixed, value; if ((*valptr) == NULL) { - (*valptr) = sdl_malloc(sizeof(sdlRestrictionInt)); + (*valptr) = emalloc(sizeof(sdlRestrictionInt)); } memset((*valptr), 0, sizeof(sdlRestrictionInt)); @@ -823,7 +823,7 @@ static int schema_restriction_var_char(xmlNodePtr val, sdlRestrictionCharPtr *va xmlAttrPtr fixed, value; if ((*valptr) == NULL) { - (*valptr) = sdl_malloc(sizeof(sdlRestrictionChar)); + (*valptr) = emalloc(sizeof(sdlRestrictionChar)); } memset((*valptr), 0, sizeof(sdlRestrictionChar)); @@ -841,7 +841,7 @@ static int schema_restriction_var_char(xmlNodePtr val, sdlRestrictionCharPtr *va php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: missing restriction value"); } - (*valptr)->value = sdl_strdup(value->children->content); + (*valptr)->value = estrdup(value->children->content); return TRUE; } @@ -985,10 +985,10 @@ static int schema_all(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr all, sdlTypePtr cur xmlAttrPtr attr; sdlContentModelPtr newModel; - newModel = sdl_malloc(sizeof(sdlContentModel)); + newModel = emalloc(sizeof(sdlContentModel)); newModel->kind = XSD_CONTENT_ALL; - newModel->u.content = sdl_malloc(sizeof(HashTable)); - zend_hash_init(newModel->u.content, 0, NULL, delete_model, SDL_PERSISTENT); + newModel->u.content = emalloc(sizeof(HashTable)); + zend_hash_init(newModel->u.content, 0, NULL, delete_model, 0); if (model == NULL) { cur_type->model = newModel; } else { @@ -1072,17 +1072,17 @@ static int schema_group(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr groupType, sdlTyp smart_str_appends(&key, type); smart_str_0(&key); - newModel = sdl_malloc(sizeof(sdlContentModel)); + newModel = emalloc(sizeof(sdlContentModel)); newModel->kind = XSD_CONTENT_GROUP_REF; newModel->u.group_ref = estrdup(key.c); if (type) {efree(type);} if (ns) {efree(ns);} } else { - newModel = sdl_malloc(sizeof(sdlContentModel)); + newModel = emalloc(sizeof(sdlContentModel)); newModel->kind = XSD_CONTENT_SEQUENCE; /* will be redefined */ - newModel->u.content = sdl_malloc(sizeof(HashTable)); - zend_hash_init(newModel->u.content, 0, NULL, delete_model, SDL_PERSISTENT); + newModel->u.content = emalloc(sizeof(HashTable)); + zend_hash_init(newModel->u.content, 0, NULL, delete_model, 0); smart_str_appends(&key, ns->children->content); smart_str_appendc(&key, ':'); @@ -1093,12 +1093,12 @@ static int schema_group(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr groupType, sdlTyp if (cur_type == NULL) { sdlTypePtr newType; - newType = sdl_malloc(sizeof(sdlType)); + newType = emalloc(sizeof(sdlType)); memset(newType, 0, sizeof(sdlType)); if (sdl->groups == NULL) { - sdl->groups = sdl_malloc(sizeof(HashTable)); - zend_hash_init(sdl->groups, 0, NULL, delete_type, SDL_PERSISTENT); + sdl->groups = emalloc(sizeof(HashTable)); + zend_hash_init(sdl->groups, 0, NULL, delete_type, 0); } if (zend_hash_add(sdl->groups, key.c, key.len+1, (void**)&newType, sizeof(sdlTypePtr), NULL) != SUCCESS) { php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: group '%s' already defined",key.c); @@ -1185,10 +1185,10 @@ static int schema_choice(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr choiceType, sdlT xmlAttrPtr attr; sdlContentModelPtr newModel; - newModel = sdl_malloc(sizeof(sdlContentModel)); + newModel = emalloc(sizeof(sdlContentModel)); newModel->kind = XSD_CONTENT_CHOICE; - newModel->u.content = sdl_malloc(sizeof(HashTable)); - zend_hash_init(newModel->u.content, 0, NULL, delete_model, SDL_PERSISTENT); + newModel->u.content = emalloc(sizeof(HashTable)); + zend_hash_init(newModel->u.content, 0, NULL, delete_model, 0); if (model == NULL) { cur_type->model = newModel; } else { @@ -1251,10 +1251,10 @@ static int schema_sequence(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr seqType, sdlTy xmlAttrPtr attr; sdlContentModelPtr newModel; - newModel = sdl_malloc(sizeof(sdlContentModel)); + newModel = emalloc(sizeof(sdlContentModel)); newModel->kind = XSD_CONTENT_SEQUENCE; - newModel->u.content = sdl_malloc(sizeof(HashTable)); - zend_hash_init(newModel->u.content, 0, NULL, delete_model, SDL_PERSISTENT); + newModel->u.content = emalloc(sizeof(HashTable)); + zend_hash_init(newModel->u.content, 0, NULL, delete_model, 0); if (model == NULL) { cur_type->model = newModel; } else { @@ -1376,27 +1376,27 @@ static int schema_complexType(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr compType, s /* Anonymous type inside <element> */ sdlTypePtr newType, *ptr; - newType = sdl_malloc(sizeof(sdlType)); + newType = emalloc(sizeof(sdlType)); memset(newType, 0, sizeof(sdlType)); newType->kind = XSD_TYPEKIND_COMPLEX; if (name != NULL) { - newType->name = sdl_strdup(name->children->content); - newType->namens = sdl_strdup(ns->children->content); + newType->name = estrdup(name->children->content); + newType->namens = estrdup(ns->children->content); } else { - newType->name = sdl_strdup(cur_type->name); - newType->namens = sdl_strdup(cur_type->namens); + newType->name = estrdup(cur_type->name); + newType->namens = estrdup(cur_type->namens); } zend_hash_next_index_insert(sdl->types, &newType, sizeof(sdlTypePtr), (void **)&ptr); if (sdl->encoders == NULL) { - sdl->encoders = sdl_malloc(sizeof(HashTable)); - zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, SDL_PERSISTENT); + sdl->encoders = emalloc(sizeof(HashTable)); + zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, 0); } - cur_type->encode = sdl_malloc(sizeof(encode)); + cur_type->encode = emalloc(sizeof(encode)); memset(cur_type->encode, 0, sizeof(encode)); - cur_type->encode->details.ns = sdl_strdup(newType->namens); - cur_type->encode->details.type_str = sdl_strdup(newType->name); + cur_type->encode->details.ns = estrdup(newType->namens); + cur_type->encode->details.type_str = estrdup(newType->name); cur_type->encode->details.sdl_type = *ptr; cur_type->encode->to_xml = sdl_guess_convert_xml; cur_type->encode->to_zval = sdl_guess_convert_zval; @@ -1407,11 +1407,11 @@ static int schema_complexType(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr compType, s } else if (name) { sdlTypePtr newType, *ptr; - newType = sdl_malloc(sizeof(sdlType)); + newType = emalloc(sizeof(sdlType)); memset(newType, 0, sizeof(sdlType)); newType->kind = XSD_TYPEKIND_COMPLEX; - newType->name = sdl_strdup(name->children->content); - newType->namens = sdl_strdup(ns->children->content); + newType->name = estrdup(name->children->content); + newType->namens = estrdup(ns->children->content); zend_hash_next_index_insert(sdl->types, &newType, sizeof(sdlTypePtr), (void **)&ptr); @@ -1510,7 +1510,7 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr element, sdlTyp sdlTypePtr newType; smart_str key = {0}; - newType = sdl_malloc(sizeof(sdlType)); + newType = emalloc(sizeof(sdlType)); memset(newType, 0, sizeof(sdlType)); if (ref) { @@ -1523,26 +1523,26 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr element, sdlTyp if (nsptr != NULL) { smart_str_appends(&nscat, nsptr->href); smart_str_appendc(&nscat, ':'); - newType->namens = sdl_strdup(nsptr->href); + newType->namens = estrdup(nsptr->href); } smart_str_appends(&nscat, type); - newType->name = sdl_strdup(type); + newType->name = estrdup(type); smart_str_0(&nscat); if (type) {efree(type);} if (ns) {efree(ns);} newType->ref = estrdup(nscat.c); smart_str_free(&nscat); } else { - newType->name = sdl_strdup(name->children->content); - newType->namens = sdl_strdup(ns->children->content); + newType->name = estrdup(name->children->content); + newType->namens = estrdup(ns->children->content); } newType->nillable = FALSE; if (cur_type == NULL) { if (sdl->elements == NULL) { - sdl->elements = sdl_malloc(sizeof(HashTable)); - zend_hash_init(sdl->elements, 0, NULL, delete_type, SDL_PERSISTENT); + sdl->elements = emalloc(sizeof(HashTable)); + zend_hash_init(sdl->elements, 0, NULL, delete_type, 0); } addHash = sdl->elements; smart_str_appends(&key, newType->namens); @@ -1550,8 +1550,8 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr element, sdlTyp smart_str_appends(&key, newType->name); } else { if (cur_type->elements == NULL) { - cur_type->elements = sdl_malloc(sizeof(HashTable)); - zend_hash_init(cur_type->elements, 0, NULL, delete_type, SDL_PERSISTENT); + cur_type->elements = emalloc(sizeof(HashTable)); + zend_hash_init(cur_type->elements, 0, NULL, delete_type, 0); } addHash = cur_type->elements; smart_str_appends(&key, newType->name); @@ -1568,7 +1568,7 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr element, sdlTyp smart_str_free(&key); if (model != NULL) { - sdlContentModelPtr newModel = sdl_malloc(sizeof(sdlContentModel)); + sdlContentModelPtr newModel = emalloc(sizeof(sdlContentModel)); newModel->kind = XSD_CONTENT_ELEMENT; newModel->u.element = newType; @@ -1618,7 +1618,7 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr element, sdlTyp if (ref != NULL) { php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: element has both 'ref' and 'fixed' attributes"); } - cur_type->fixed = sdl_strdup(attr->children->content); + cur_type->fixed = estrdup(attr->children->content); } attr = get_attribute(attrs, "default"); @@ -1628,7 +1628,7 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr element, sdlTyp } else if (ref != NULL) { php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: element has both 'default' and 'fixed' attributes"); } - cur_type->def = sdl_strdup(attr->children->content); + cur_type->def = estrdup(attr->children->content); } /* type = QName */ @@ -1717,7 +1717,7 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr attrType, sdl HashTable *addHash; smart_str key = {0}; - newAttr = sdl_malloc(sizeof(sdlAttribute)); + newAttr = emalloc(sizeof(sdlAttribute)); memset(newAttr, 0, sizeof(sdlAttribute)); if (ref) { @@ -1754,8 +1754,8 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr attrType, sdl addHash = ctx->attributes; } else { if (cur_type->attributes == NULL) { - cur_type->attributes = sdl_malloc(sizeof(HashTable)); - zend_hash_init(cur_type->attributes, 0, NULL, delete_attribute, SDL_PERSISTENT); + cur_type->attributes = emalloc(sizeof(HashTable)); + zend_hash_init(cur_type->attributes, 0, NULL, delete_attribute, 0); } addHash = cur_type->attributes; } @@ -1789,9 +1789,9 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr attrType, sdl attr = attrType->properties; while (attr != NULL) { if (attr_is_equal_ex(attr, "default", SCHEMA_NAMESPACE)) { - newAttr->def = sdl_strdup(attr->children->content); + newAttr->def = estrdup(attr->children->content); } else if (attr_is_equal_ex(attr, "fixed", SCHEMA_NAMESPACE)) { - newAttr->fixed = sdl_strdup(attr->children->content); + newAttr->fixed = estrdup(attr->children->content); } else if (attr_is_equal_ex(attr, "form", SCHEMA_NAMESPACE)) { if (strncmp(attr->children->content,"qualified",sizeof("qualified")) == 0) { newAttr->form = XSD_FORM_QUALIFIED; @@ -1803,7 +1803,7 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr attrType, sdl } else if (attr_is_equal_ex(attr, "id", SCHEMA_NAMESPACE)) { /* skip */ } else if (attr_is_equal_ex(attr, "name", SCHEMA_NAMESPACE)) { - newAttr->name = sdl_strdup(attr->children->content); + newAttr->name = estrdup(attr->children->content); } else if (attr_is_equal_ex(attr, "ref", SCHEMA_NAMESPACE)) { /* already processed */ } else if (attr_is_equal_ex(attr, "type", SCHEMA_NAMESPACE)) { @@ -1827,22 +1827,22 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr attrType, sdl xmlNsPtr nsptr; char *value, *ns; - ext = sdl_malloc(sizeof(sdlExtraAttribute)); + ext = emalloc(sizeof(sdlExtraAttribute)); memset(ext, 0, sizeof(sdlExtraAttribute)); parse_namespace(attr->children->content, &value, &ns); nsptr = xmlSearchNs(attr->doc, attr->parent, ns); if (nsptr) { - ext->ns = sdl_strdup(nsptr->href); - ext->val = sdl_strdup(value); + ext->ns = estrdup(nsptr->href); + ext->val = estrdup(value); } else { - ext->val = sdl_strdup(attr->children->content); + ext->val = estrdup(attr->children->content); } if (ns) {efree(ns);} efree(value); if (!newAttr->extraAttributes) { - newAttr->extraAttributes = sdl_malloc(sizeof(HashTable)); - zend_hash_init(newAttr->extraAttributes, 0, NULL, delete_extra_attribute, SDL_PERSISTENT); + newAttr->extraAttributes = emalloc(sizeof(HashTable)); + zend_hash_init(newAttr->extraAttributes, 0, NULL, delete_extra_attribute, 0); } smart_str_appends(&key2, nsPtr->href); @@ -1869,10 +1869,10 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr attrType, sdl } else if (type != NULL) { php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: attribute has both 'type' attribute and subtype"); } - dummy_type = sdl_malloc(sizeof(sdlType)); + dummy_type = emalloc(sizeof(sdlType)); memset(dummy_type, 0, sizeof(sdlType)); - dummy_type->name = sdl_strdup("anonymous"); - dummy_type->namens = sdl_strdup(tsn->children->content); + dummy_type->name = estrdup("anonymous"); + dummy_type->namens = estrdup(tsn->children->content); schema_simpleType(sdl, tsn, trav, dummy_type); newAttr->encode = dummy_type->encode; delete_type(&dummy_type); @@ -1905,10 +1905,10 @@ static int schema_attributeGroup(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr attrGrou if (ns == NULL) { ns = tsn; } - newType = sdl_malloc(sizeof(sdlType)); + newType = emalloc(sizeof(sdlType)); memset(newType, 0, sizeof(sdlType)); - newType->name = sdl_strdup(name->children->content); - newType->namens = sdl_strdup(ns->children->content); + newType->name = estrdup(name->children->content); + newType->namens = estrdup(ns->children->content); smart_str_appends(&key, newType->namens); smart_str_appendc(&key, ':'); @@ -1927,10 +1927,10 @@ static int schema_attributeGroup(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr attrGrou xmlNsPtr nsptr; if (cur_type->attributes == NULL) { - cur_type->attributes = sdl_malloc(sizeof(HashTable)); - zend_hash_init(cur_type->attributes, 0, NULL, delete_attribute, SDL_PERSISTENT); + cur_type->attributes = emalloc(sizeof(HashTable)); + zend_hash_init(cur_type->attributes, 0, NULL, delete_attribute, 0); } - newAttr = sdl_malloc(sizeof(sdlAttribute)); + newAttr = emalloc(sizeof(sdlAttribute)); memset(newAttr, 0, sizeof(sdlAttribute)); parse_namespace(ref->children->content, &group_name, &ns); @@ -1988,14 +1988,14 @@ static void copy_extra_attribute(void *attribute) sdlExtraAttributePtr *attr = (sdlExtraAttributePtr*)attribute; sdlExtraAttributePtr new_attr; - new_attr = sdl_malloc(sizeof(sdlExtraAttribute)); + new_attr = emalloc(sizeof(sdlExtraAttribute)); memcpy(new_attr, *attr, sizeof(sdlExtraAttribute)); *attr = new_attr; if (new_attr->ns) { - new_attr->ns = sdl_strdup(new_attr->ns); + new_attr->ns = estrdup(new_attr->ns); } if (new_attr->val) { - new_attr->val = sdl_strdup(new_attr->val); + new_attr->val = estrdup(new_attr->val); } } @@ -2008,13 +2008,13 @@ static void schema_attribute_fixup(sdlCtx *ctx, sdlAttributePtr attr) if (zend_hash_find(ctx->attributes, attr->ref, strlen(attr->ref)+1, (void**)&tmp) == SUCCESS) { schema_attribute_fixup(ctx, *tmp); if ((*tmp)->name != NULL && attr->name == NULL) { - attr->name = sdl_strdup((*tmp)->name); + attr->name = estrdup((*tmp)->name); } if ((*tmp)->def != NULL && attr->def == NULL) { - attr->def = sdl_strdup((*tmp)->def); + attr->def = estrdup((*tmp)->def); } if ((*tmp)->fixed != NULL && attr->fixed == NULL) { - attr->fixed = sdl_strdup((*tmp)->fixed); + attr->fixed = estrdup((*tmp)->fixed); } if (attr->form == XSD_FORM_DEFAULT) { attr->form = (*tmp)->form; @@ -2025,8 +2025,8 @@ static void schema_attribute_fixup(sdlCtx *ctx, sdlAttributePtr attr) if ((*tmp)->extraAttributes != NULL) { xmlNodePtr node; - attr->extraAttributes = sdl_malloc(sizeof(HashTable)); - zend_hash_init(attr->extraAttributes, 0, NULL, delete_extra_attribute, SDL_PERSISTENT); + attr->extraAttributes = emalloc(sizeof(HashTable)); + zend_hash_init(attr->extraAttributes, 0, NULL, delete_extra_attribute, 0); zend_hash_copy(attr->extraAttributes, (*tmp)->extraAttributes, copy_extra_attribute, &node, sizeof(xmlNodePtr)); } attr->encode = (*tmp)->encode; @@ -2035,9 +2035,9 @@ static void schema_attribute_fixup(sdlCtx *ctx, sdlAttributePtr attr) if (attr->name == NULL && attr->ref != NULL) { char *name = strrchr(attr->ref, ':'); if (*name) { - attr->name = sdl_strdup(name+1); + attr->name = estrdup(name+1); } else{ - attr->name = sdl_strdup(attr->ref); + attr->name = estrdup(attr->ref); } } efree(attr->ref); @@ -2063,15 +2063,15 @@ static void schema_attributegroup_fixup(sdlCtx *ctx, sdlAttributePtr attr, HashT schema_attribute_fixup(ctx,*tmp_attr); - newAttr = sdl_malloc(sizeof(sdlAttribute)); + newAttr = emalloc(sizeof(sdlAttribute)); memcpy(newAttr, *tmp_attr, sizeof(sdlAttribute)); - if (newAttr->def) {newAttr->def = sdl_strdup(newAttr->def);} - if (newAttr->fixed) {newAttr->fixed = sdl_strdup(newAttr->fixed);} - if (newAttr->name) {newAttr->name = sdl_strdup(newAttr->name);} + if (newAttr->def) {newAttr->def = estrdup(newAttr->def);} + if (newAttr->fixed) {newAttr->fixed = estrdup(newAttr->fixed);} + if (newAttr->name) {newAttr->name = estrdup(newAttr->name);} if (newAttr->extraAttributes) { xmlNodePtr node; - HashTable *ht = sdl_malloc(sizeof(HashTable)); - zend_hash_init(ht, 0, NULL, delete_extra_attribute, SDL_PERSISTENT); + HashTable *ht = emalloc(sizeof(HashTable)); + zend_hash_init(ht, 0, NULL, delete_extra_attribute, 0); zend_hash_copy(ht, newAttr->extraAttributes, copy_extra_attribute, &node, sizeof(xmlNodePtr)); newAttr->extraAttributes = ht; } @@ -2235,37 +2235,37 @@ void delete_model(void *handle) case XSD_CONTENT_ALL: case XSD_CONTENT_CHOICE: zend_hash_destroy(tmp->u.content); - sdl_free(tmp->u.content); + efree(tmp->u.content); break; case XSD_CONTENT_GROUP_REF: efree(tmp->u.group_ref); break; } - sdl_free(tmp); + efree(tmp); } void delete_type(void *data) { sdlTypePtr type = *((sdlTypePtr*)data); if (type->name) { - sdl_free(type->name); + efree(type->name); } if (type->namens) { - sdl_free(type->namens); + efree(type->namens); } if (type->def) { - sdl_free(type->def); + efree(type->def); } if (type->fixed) { - sdl_free(type->fixed); + efree(type->fixed); } if (type->elements) { zend_hash_destroy(type->elements); - sdl_free(type->elements); + efree(type->elements); } if (type->attributes) { zend_hash_destroy(type->attributes); - sdl_free(type->attributes); + efree(type->attributes); } if (type->model) { delete_model((void**)&type->model); @@ -2284,11 +2284,11 @@ void delete_type(void *data) delete_restriction_var_char(&type->restrictions->pattern); if (type->restrictions->enumeration) { zend_hash_destroy(type->restrictions->enumeration); - sdl_free(type->restrictions->enumeration); + efree(type->restrictions->enumeration); } - sdl_free(type->restrictions); + efree(type->restrictions); } - sdl_free(type); + efree(type); } void delete_extra_attribute(void *attribute) @@ -2296,12 +2296,12 @@ void delete_extra_attribute(void *attribute) sdlExtraAttributePtr attr = *((sdlExtraAttributePtr*)attribute); if (attr->ns) { - sdl_free(attr->ns); + efree(attr->ns); } if (attr->val) { - sdl_free(attr->val); + efree(attr->val); } - sdl_free(attr); + efree(attr); } void delete_attribute(void *attribute) @@ -2309,29 +2309,29 @@ void delete_attribute(void *attribute) sdlAttributePtr attr = *((sdlAttributePtr*)attribute); if (attr->def) { - sdl_free(attr->def); + efree(attr->def); } if (attr->fixed) { - sdl_free(attr->fixed); + efree(attr->fixed); } if (attr->name) { - sdl_free(attr->name); + efree(attr->name); } if (attr->ref) { - sdl_free(attr->ref); + efree(attr->ref); } if (attr->extraAttributes) { zend_hash_destroy(attr->extraAttributes); - sdl_free(attr->extraAttributes); + efree(attr->extraAttributes); } - sdl_free(attr); + efree(attr); } void delete_restriction_var_int(void *rvi) { sdlRestrictionIntPtr ptr = *((sdlRestrictionIntPtr*)rvi); if (ptr) { - sdl_free(ptr); + efree(ptr); } } @@ -2340,8 +2340,8 @@ void delete_restriction_var_char(void *srvc) sdlRestrictionCharPtr ptr = *((sdlRestrictionCharPtr*)srvc); if (ptr) { if (ptr->value) { - sdl_free(ptr->value); + efree(ptr->value); } - sdl_free(ptr); + efree(ptr); } } diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index ff9a906ee3..d8a25863cf 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -199,7 +199,7 @@ static void load_wsdl_ex(char *struri, sdlCtx *ctx, int include) if (!include) { targetNamespace = get_attribute(definitions->properties, "targetNamespace"); if (targetNamespace) { - tmpsdl->target_ns = sdl_strdup(targetNamespace->children->content); + tmpsdl->target_ns = estrdup(targetNamespace->children->content); } } @@ -303,13 +303,13 @@ static void wsdl_soap_binding_body(sdlCtx* ctx, xmlNodePtr node, char* wsdl_soap tmp = get_attribute(body->properties, "namespace"); if (tmp) { - binding->ns = sdl_strdup(tmp->children->content); + binding->ns = estrdup(tmp->children->content); } tmp = get_attribute(body->properties, "parts"); if (tmp) { whiteSpace_collapse(tmp->children->content); - binding->parts = sdl_strdup(tmp->children->content); + binding->parts = estrdup(tmp->children->content); } if (binding->use == SOAP_ENCODED) { @@ -321,7 +321,7 @@ static void wsdl_soap_binding_body(sdlCtx* ctx, xmlNodePtr node, char* wsdl_soap } else if (tmp == NULL) { php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Unspecified encodingStyle"); } else { - binding->encodingStyle = sdl_strdup(tmp->children->content); + binding->encodingStyle = estrdup(tmp->children->content); } } } else if (node_is_equal_ex(trav, "header", wsdl_soap_namespace)) { @@ -356,9 +356,9 @@ static void wsdl_soap_binding_body(sdlCtx* ctx, xmlNodePtr node, char* wsdl_soap php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Missing part '%s' in <message>",tmp->children->content); } - h = sdl_malloc(sizeof(sdlSoapBindingFunctionHeader)); + h = emalloc(sizeof(sdlSoapBindingFunctionHeader)); memset(h, 0, sizeof(sdlSoapBindingFunctionHeader)); - h->name = sdl_strdup(tmp->children->content); + h->name = estrdup(tmp->children->content); tmp = get_attribute(part->properties, "type"); if (tmp != NULL) { @@ -382,7 +382,7 @@ static void wsdl_soap_binding_body(sdlCtx* ctx, xmlNodePtr node, char* wsdl_soap tmp = get_attribute(header->properties, "namespace"); if (tmp) { - h->ns = sdl_strdup(tmp->children->content); + h->ns = estrdup(tmp->children->content); } if (h->use == SOAP_ENCODED) { @@ -394,13 +394,13 @@ static void wsdl_soap_binding_body(sdlCtx* ctx, xmlNodePtr node, char* wsdl_soap } else if (tmp == NULL) { php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Unspecified encodingStyle"); } else { - h->encodingStyle = sdl_strdup(tmp->children->content); + h->encodingStyle = estrdup(tmp->children->content); } } if (binding->headers == NULL) { - binding->headers = sdl_malloc(sizeof(HashTable)); - zend_hash_init(binding->headers, 0, NULL, delete_header, SDL_PERSISTENT); + binding->headers = emalloc(sizeof(HashTable)); + zend_hash_init(binding->headers, 0, NULL, delete_header, 0); } if (h->ns) { @@ -437,8 +437,8 @@ static HashTable* wsdl_message(sdlCtx *ctx, char* message_name) } message = *tmp; - parameters = sdl_malloc(sizeof(HashTable)); - zend_hash_init(parameters, 0, NULL, delete_parameter, SDL_PERSISTENT); + parameters = emalloc(sizeof(HashTable)); + zend_hash_init(parameters, 0, NULL, delete_parameter, 0); trav = message->children; while (trav != NULL) { @@ -456,7 +456,7 @@ static HashTable* wsdl_message(sdlCtx *ctx, char* message_name) php_error(E_ERROR,"SOAP-ERROR: Parsing WSDL: Unexpected WSDL element <%s>",trav->name); } part = trav; - param = sdl_malloc(sizeof(sdlParam)); + param = emalloc(sizeof(sdlParam)); memset(param,0,sizeof(sdlParam)); param->order = 0; @@ -465,7 +465,7 @@ static HashTable* wsdl_message(sdlCtx *ctx, char* message_name) php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: No name associated with <part> '%s'", message->name); } - param->paramName = sdl_strdup(name->children->content); + param->paramName = estrdup(name->children->content); type = get_attribute(part->properties, "type"); if (type != NULL) { @@ -493,10 +493,10 @@ static sdlPtr load_wsdl(char *struri) int i,n; memset(&ctx,0,sizeof(ctx)); - ctx.sdl = sdl_malloc(sizeof(sdl)); + ctx.sdl = emalloc(sizeof(sdl)); memset(ctx.sdl, 0, sizeof(sdl)); - ctx.sdl->source = sdl_strdup(struri); - zend_hash_init(&ctx.sdl->functions, 0, NULL, delete_function, SDL_PERSISTENT); + ctx.sdl->source = estrdup(struri); + zend_hash_init(&ctx.sdl->functions, 0, NULL, delete_function, 0); zend_hash_init(&ctx.docs, 0, NULL, delete_document, 0); zend_hash_init(&ctx.messages, 0, NULL, NULL, 0); @@ -536,7 +536,7 @@ static sdlPtr load_wsdl(char *struri) port = trav; - tmpbinding = sdl_malloc(sizeof(sdlBinding)); + tmpbinding = emalloc(sizeof(sdlBinding)); memset(tmpbinding, 0, sizeof(sdlBinding)); bindingAttr = get_attribute(port->properties, "binding"); @@ -583,7 +583,7 @@ static sdlPtr load_wsdl(char *struri) php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: No location associated with <port>"); } - tmpbinding->location = sdl_strdup(location->children->content); + tmpbinding->location = estrdup(location->children->content); ctype = strrchr(bindingAttr->children->content,':'); if (ctype == NULL) { @@ -601,7 +601,7 @@ static sdlPtr load_wsdl(char *struri) xmlNodePtr soapBindingNode; xmlAttrPtr tmp; - soapBinding = sdl_malloc(sizeof(sdlSoapBinding)); + soapBinding = emalloc(sizeof(sdlSoapBinding)); memset(soapBinding, 0, sizeof(sdlSoapBinding)); soapBinding->style = SOAP_DOCUMENT; @@ -617,7 +617,7 @@ static sdlPtr load_wsdl(char *struri) if (strncmp(tmp->children->content, WSDL_HTTP_TRANSPORT, sizeof(WSDL_HTTP_TRANSPORT))) { php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: PHP-SOAP doesn't support transport '%s'", tmp->children->content); } - soapBinding->transport = sdl_strdup(tmp->children->content); + soapBinding->transport = estrdup(tmp->children->content); } } tmpbinding->bindingAttributes = (void *)soapBinding; @@ -627,7 +627,7 @@ static sdlPtr load_wsdl(char *struri) if (name == NULL) { php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Missing 'name' attribute for <binding>"); } - tmpbinding->name = sdl_strdup(name->children->content); + tmpbinding->name = estrdup(name->children->content); type = get_attribute(binding->properties, "type"); if (type == NULL) { @@ -688,8 +688,8 @@ static sdlPtr load_wsdl(char *struri) php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Missing <portType>/<operation> with name '%s'", op_name->children->content); } - function = sdl_malloc(sizeof(sdlFunction)); - function->functionName = sdl_strdup(op_name->children->content); + function = emalloc(sizeof(sdlFunction)); + function->functionName = estrdup(op_name->children->content); function->requestParameters = NULL; function->responseParameters = NULL; function->responseName = NULL; @@ -702,7 +702,7 @@ static sdlPtr load_wsdl(char *struri) xmlNodePtr soapOperation; xmlAttrPtr tmp; - soapFunctionBinding = sdl_malloc(sizeof(sdlSoapBindingFunction)); + soapFunctionBinding = emalloc(sizeof(sdlSoapBindingFunction)); memset(soapFunctionBinding, 0, sizeof(sdlSoapBindingFunction)); soapBinding = (sdlSoapBindingPtr)tmpbinding->bindingAttributes; soapFunctionBinding->style = soapBinding->style; @@ -711,7 +711,7 @@ static sdlPtr load_wsdl(char *struri) if (soapOperation) { tmp = get_attribute(soapOperation->properties, "soapAction"); if (tmp) { - soapFunctionBinding->soapAction = sdl_strdup(tmp->children->content); + soapFunctionBinding->soapAction = estrdup(tmp->children->content); } tmp = get_attribute(soapOperation->properties, "style"); @@ -741,9 +741,9 @@ static sdlPtr load_wsdl(char *struri) name = get_attribute(input->properties, "name"); if (name != NULL) { - function->requestName = sdl_strdup(name->children->content); + function->requestName = estrdup(name->children->content); } else { - function->requestName = sdl_strdup(function->functionName); + function->requestName = estrdup(function->functionName); } if (tmpbinding->bindingType == BINDING_SOAP) { @@ -767,12 +767,12 @@ static sdlPtr load_wsdl(char *struri) name = get_attribute(output->properties, "name"); if (name != NULL) { - function->responseName = sdl_strdup(name->children->content); + function->responseName = estrdup(name->children->content); } else if (input == NULL) { - function->responseName = sdl_strdup(function->functionName); + function->responseName = estrdup(function->functionName); } else { int len = strlen(function->functionName); - function->responseName = sdl_malloc(len + sizeof("Response")); + function->responseName = emalloc(len + sizeof("Response")); memcpy(function->responseName, function->functionName, len); memcpy(function->responseName+len, "Response", sizeof("Response")); } @@ -808,8 +808,8 @@ static sdlPtr load_wsdl(char *struri) efree(tmp); if (function->requestName != NULL && strcmp(function->requestName,function->functionName) != 0) { if (ctx.sdl->requests == NULL) { - ctx.sdl->requests = sdl_malloc(sizeof(HashTable)); - zend_hash_init(ctx.sdl->requests, 0, NULL, NULL, SDL_PERSISTENT); + ctx.sdl->requests = emalloc(sizeof(HashTable)); + zend_hash_init(ctx.sdl->requests, 0, NULL, NULL, 0); } tmp = estrdup(function->requestName); len = strlen(tmp); @@ -821,8 +821,8 @@ static sdlPtr load_wsdl(char *struri) } if (!ctx.sdl->bindings) { - ctx.sdl->bindings = sdl_malloc(sizeof(HashTable)); - zend_hash_init(ctx.sdl->bindings, 0, NULL, delete_binding, SDL_PERSISTENT); + ctx.sdl->bindings = emalloc(sizeof(HashTable)); + zend_hash_init(ctx.sdl->bindings, 0, NULL, delete_binding, 0); } zend_hash_add(ctx.sdl->bindings, tmpbinding->name, strlen(tmpbinding->name), &tmpbinding, sizeof(sdlBindingPtr), NULL); @@ -868,7 +868,7 @@ static char* sdl_deserialize_string(char **in) if (len == 0) { return NULL; } else { - s = sdl_malloc(len+1); + s = emalloc(len+1); WSDL_CACHE_GET_N(s, len, in); s[len] = '\0'; return s; @@ -902,10 +902,10 @@ static void sdl_deserialize_attribute(sdlAttributePtr attr, encodePtr *encoders, attr->encode = encoders[i]; WSDL_CACHE_GET_INT(i, in); if (i > 0) { - attr->extraAttributes = sdl_malloc(sizeof(HashTable)); - zend_hash_init(attr->extraAttributes, i, NULL, delete_extra_attribute, SDL_PERSISTENT); + attr->extraAttributes = emalloc(sizeof(HashTable)); + zend_hash_init(attr->extraAttributes, i, NULL, delete_extra_attribute, 0); while (i > 0) { - sdlExtraAttributePtr x = sdl_malloc(sizeof(sdlExtraAttribute)); + sdlExtraAttributePtr x = emalloc(sizeof(sdlExtraAttribute)); sdl_deserialize_key(attr->extraAttributes, x, in); x->ns = sdl_deserialize_string(in); x->val = sdl_deserialize_string(in); @@ -917,7 +917,7 @@ static void sdl_deserialize_attribute(sdlAttributePtr attr, encodePtr *encoders, static sdlRestrictionIntPtr sdl_deserialize_resriction_int(char **in) { if (**in == 1) { - sdlRestrictionIntPtr x = sdl_malloc(sizeof(sdlRestrictionInt)); + sdlRestrictionIntPtr x = emalloc(sizeof(sdlRestrictionInt)); WSDL_CACHE_SKIP(1, in); WSDL_CACHE_GET_INT(x->value, in); WSDL_CACHE_GET_1(x->fixed, char, in); @@ -931,7 +931,7 @@ static sdlRestrictionIntPtr sdl_deserialize_resriction_int(char **in) static sdlRestrictionCharPtr sdl_deserialize_resriction_char(char **in) { if (**in == 1) { - sdlRestrictionCharPtr x = sdl_malloc(sizeof(sdlRestrictionChar)); + sdlRestrictionCharPtr x = emalloc(sizeof(sdlRestrictionChar)); WSDL_CACHE_SKIP(1, in); x->value = sdl_deserialize_string(in); WSDL_CACHE_GET_1(x->fixed, char, in); @@ -945,7 +945,7 @@ static sdlRestrictionCharPtr sdl_deserialize_resriction_char(char **in) static sdlContentModelPtr sdl_deserialize_model(sdlTypePtr *types, sdlTypePtr *elements, char **in) { int i; - sdlContentModelPtr model = sdl_malloc(sizeof(sdlContentModel)); + sdlContentModelPtr model = emalloc(sizeof(sdlContentModel)); WSDL_CACHE_GET_1(model->kind, sdlContentKind, in); WSDL_CACHE_GET_INT(model->min_occurs, in); @@ -960,8 +960,8 @@ static sdlContentModelPtr sdl_deserialize_model(sdlTypePtr *types, sdlTypePtr *e case XSD_CONTENT_CHOICE: WSDL_CACHE_GET_INT(i, in); if (i > 0) { - model->u.content = sdl_malloc(sizeof(HashTable)); - zend_hash_init(model->u.content, i, NULL, delete_model, SDL_PERSISTENT); + model->u.content = emalloc(sizeof(HashTable)); + zend_hash_init(model->u.content, i, NULL, delete_model, 0); while (i > 0) { sdlContentModelPtr x = sdl_deserialize_model(types, elements, in); zend_hash_next_index_insert(model->u.content,&x,sizeof(sdlContentModelPtr),NULL); @@ -1000,7 +1000,7 @@ static void sdl_deserialize_type(sdlTypePtr type, sdlTypePtr *types, encodePtr * if (**in == 1) { WSDL_CACHE_SKIP(1, in); - type->restrictions = sdl_malloc(sizeof(sdlRestrictions)); + type->restrictions = emalloc(sizeof(sdlRestrictions)); /*memset(type->restrictions, 0, sizeof(sdlRestrictions));*/ type->restrictions->minExclusive = sdl_deserialize_resriction_int(in); type->restrictions->minInclusive = sdl_deserialize_resriction_int(in); @@ -1015,8 +1015,8 @@ static void sdl_deserialize_type(sdlTypePtr type, sdlTypePtr *types, encodePtr * type->restrictions->pattern = sdl_deserialize_resriction_char(in); WSDL_CACHE_GET_INT(i, in); if (i > 0) { - type->restrictions->enumeration = sdl_malloc(sizeof(HashTable)); - zend_hash_init(type->restrictions->enumeration, i, NULL, delete_restriction_var_char, SDL_PERSISTENT); + type->restrictions->enumeration = emalloc(sizeof(HashTable)); + zend_hash_init(type->restrictions->enumeration, i, NULL, delete_restriction_var_char, 0); while (i > 0) { sdlRestrictionCharPtr x = sdl_deserialize_resriction_char(in); sdl_deserialize_key(type->restrictions->enumeration, x, in); @@ -1033,10 +1033,10 @@ static void sdl_deserialize_type(sdlTypePtr type, sdlTypePtr *types, encodePtr * if (i > 0) { elements = do_alloca((i+1) * sizeof(sdlTypePtr)); elements[0] = NULL; - type->elements = sdl_malloc(sizeof(HashTable)); - zend_hash_init(type->elements, i, NULL, delete_type, SDL_PERSISTENT); + type->elements = emalloc(sizeof(HashTable)); + zend_hash_init(type->elements, i, NULL, delete_type, 0); while (i > 0) { - sdlTypePtr t = sdl_malloc(sizeof(sdlType)); + sdlTypePtr t = emalloc(sizeof(sdlType)); memset(t, 0, sizeof(sdlType)); sdl_deserialize_key(type->elements, t, in); sdl_deserialize_type(t, types, encoders, in); @@ -1047,10 +1047,10 @@ static void sdl_deserialize_type(sdlTypePtr type, sdlTypePtr *types, encodePtr * WSDL_CACHE_GET_INT(i, in); if (i > 0) { - type->attributes = sdl_malloc(sizeof(HashTable)); - zend_hash_init(type->attributes, i, NULL, delete_attribute, SDL_PERSISTENT); + type->attributes = emalloc(sizeof(HashTable)); + zend_hash_init(type->attributes, i, NULL, delete_attribute, 0); while (i > 0) { - sdlAttributePtr attr = sdl_malloc(sizeof(sdlAttribute)); + sdlAttributePtr attr = emalloc(sizeof(sdlAttribute)); memset(attr, 0, sizeof(sdlAttribute)); sdl_deserialize_key(type->attributes, attr, in); sdl_deserialize_attribute(attr, encoders, in); @@ -1092,10 +1092,10 @@ static void sdl_deserialize_soap_body(sdlSoapBindingFunctionBodyPtr body, encode body->encodingStyle = sdl_deserialize_string(in); WSDL_CACHE_GET_INT(i, in); if (i > 0) { - body->headers = sdl_malloc(sizeof(HashTable)); - zend_hash_init(body->headers, i, NULL, delete_header, SDL_PERSISTENT); + body->headers = emalloc(sizeof(HashTable)); + zend_hash_init(body->headers, i, NULL, delete_header, 0); while (i > 0) { - sdlSoapBindingFunctionHeaderPtr tmp = sdl_malloc(sizeof(sdlSoapBindingFunctionHeader)); + sdlSoapBindingFunctionHeaderPtr tmp = emalloc(sizeof(sdlSoapBindingFunctionHeader)); sdl_deserialize_key(body->headers, tmp, in); WSDL_CACHE_GET_1(tmp->use, sdlEncodingUse, in); tmp->name = sdl_deserialize_string(in); @@ -1117,10 +1117,10 @@ static HashTable* sdl_deserialize_parameters(encodePtr *encoders, sdlTypePtr *ty WSDL_CACHE_GET_INT(i, in); if (i == 0) {return NULL;} - ht = sdl_malloc(sizeof(HashTable)); - zend_hash_init(ht, i, NULL, delete_parameter, SDL_PERSISTENT); + ht = emalloc(sizeof(HashTable)); + zend_hash_init(ht, i, NULL, delete_parameter, 0); while (i > 0) { - sdlParamPtr param = sdl_malloc(sizeof(sdlParam)); + sdlParamPtr param = emalloc(sizeof(sdlParam)); sdl_deserialize_key(ht, param, in); param->paramName = sdl_deserialize_string(in); WSDL_CACHE_GET_INT(param->order, in); @@ -1186,7 +1186,7 @@ static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t) } WSDL_CACHE_SKIP(i, &in); - sdl = sdl_malloc(sizeof(*sdl)); + sdl = emalloc(sizeof(*sdl)); memset(sdl, 0, sizeof(*sdl)); sdl->source = sdl_deserialize_string(&in); @@ -1201,7 +1201,7 @@ static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t) types = do_alloca((i+1)*sizeof(sdlTypePtr)); types[0] = NULL; while (i > 0) { - types[i] = sdl_malloc(sizeof(sdlType)); + types[i] = emalloc(sizeof(sdlType)); memset(types[i], 0, sizeof(sdlType)); i--; } @@ -1215,7 +1215,7 @@ static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t) i = num_encoders; encoders[0] = NULL; while (i > 0) { - encoders[i] = sdl_malloc(sizeof(encode)); + encoders[i] = emalloc(sizeof(encode)); memset(encoders[i], 0, sizeof(encode)); i--; } @@ -1227,8 +1227,8 @@ static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t) i = 1; if (num_groups > 0) { - sdl->groups = sdl_malloc(sizeof(HashTable)); - zend_hash_init(sdl->groups, num_groups, NULL, delete_type, SDL_PERSISTENT); + sdl->groups = emalloc(sizeof(HashTable)); + zend_hash_init(sdl->groups, num_groups, NULL, delete_type, 0); while (i < num_groups+1) { sdl_deserialize_key(sdl->groups, types[i], &in); sdl_deserialize_type(types[i], types, encoders, &in); @@ -1237,8 +1237,8 @@ static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t) } if (num_types > 0) { - sdl->types = sdl_malloc(sizeof(HashTable)); - zend_hash_init(sdl->types, num_types, NULL, delete_type, SDL_PERSISTENT); + sdl->types = emalloc(sizeof(HashTable)); + zend_hash_init(sdl->types, num_types, NULL, delete_type, 0); while (i < num_groups+num_types+1) { sdl_deserialize_key(sdl->types, types[i], &in); sdl_deserialize_type(types[i], types, encoders, &in); @@ -1247,8 +1247,8 @@ static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t) } if (num_elements > 0) { - sdl->elements = sdl_malloc(sizeof(HashTable)); - zend_hash_init(sdl->elements, num_elements, NULL, delete_type, SDL_PERSISTENT); + sdl->elements = emalloc(sizeof(HashTable)); + zend_hash_init(sdl->elements, num_elements, NULL, delete_type, 0); while (i < num_groups+num_types+num_elements+1) { sdl_deserialize_key(sdl->elements, types[i], &in); sdl_deserialize_type(types[i], types, encoders, &in); @@ -1258,8 +1258,8 @@ static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t) i = 1; if (num_encoders > 0) { - sdl->encoders = sdl_malloc(sizeof(HashTable)); - zend_hash_init(sdl->encoders, num_encoders, NULL, delete_encoder, SDL_PERSISTENT); + sdl->encoders = emalloc(sizeof(HashTable)); + zend_hash_init(sdl->encoders, num_encoders, NULL, delete_encoder, 0); while (i < num_encoders+1) { sdl_deserialize_key(sdl->encoders, encoders[i], &in); sdl_deserialize_encoder(encoders[i], types, &in); @@ -1271,10 +1271,10 @@ static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t) WSDL_CACHE_GET_INT(num_bindings, &in); bindings = do_alloca(num_bindings*sizeof(sdlBindingPtr)); if (num_bindings > 0) { - sdl->bindings = sdl_malloc(sizeof(HashTable)); - zend_hash_init(sdl->bindings, num_bindings, NULL, delete_binding, SDL_PERSISTENT); + sdl->bindings = emalloc(sizeof(HashTable)); + zend_hash_init(sdl->bindings, num_bindings, NULL, delete_binding, 0); for (i = 0; i < num_bindings; i++) { - sdlBindingPtr binding = sdl_malloc(sizeof(sdlBinding)); + sdlBindingPtr binding = emalloc(sizeof(sdlBinding)); memset(binding, 0, sizeof(sdlBinding)); sdl_deserialize_key(sdl->bindings, binding, &in); binding->name = sdl_deserialize_string(&in); @@ -1282,7 +1282,7 @@ static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t) WSDL_CACHE_GET_1(binding->bindingType,sdlBindingType,&in); if (binding->bindingType == BINDING_SOAP) { if (*in != 0) { - sdlSoapBindingPtr soap_binding = binding->bindingAttributes = sdl_malloc(sizeof(sdlSoapBinding)); + sdlSoapBindingPtr soap_binding = binding->bindingAttributes = emalloc(sizeof(sdlSoapBinding)); WSDL_CACHE_GET_1(soap_binding->style,sdlEncodingStyle,&in); soap_binding->transport = sdl_deserialize_string(&in); } else { @@ -1295,11 +1295,11 @@ static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t) /* deserialize functions */ WSDL_CACHE_GET_INT(num_func, &in); - zend_hash_init(&sdl->functions, num_func, NULL, delete_function, SDL_PERSISTENT); + zend_hash_init(&sdl->functions, num_func, NULL, delete_function, 0); functions = do_alloca(num_func*sizeof(sdlFunctionPtr)); for (i = 0; i < num_func; i++) { int binding_num; - sdlFunctionPtr func = sdl_malloc(sizeof(sdlFunction)); + sdlFunctionPtr func = emalloc(sizeof(sdlFunction)); sdl_deserialize_key(&sdl->functions, func, &in); func->functionName = sdl_deserialize_string(&in); func->requestName = sdl_deserialize_string(&in); @@ -1313,7 +1313,7 @@ static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t) } if (func->binding && func->binding->bindingType == BINDING_SOAP) { if (*in != 0) { - sdlSoapBindingFunctionPtr binding = func->bindingAttributes = sdl_malloc(sizeof(sdlSoapBindingFunction)); + sdlSoapBindingFunctionPtr binding = func->bindingAttributes = emalloc(sizeof(sdlSoapBindingFunction)); memset(binding, 0, sizeof(sdlSoapBindingFunction)); WSDL_CACHE_GET_1(binding->style,sdlEncodingStyle,&in); binding->soapAction = sdl_deserialize_string(&in); @@ -1332,8 +1332,8 @@ static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t) /* deserialize requests */ WSDL_CACHE_GET_INT(i, &in); if (i > 0) { - sdl->requests = sdl_malloc(sizeof(HashTable)); - zend_hash_init(sdl->requests, i, NULL, NULL, SDL_PERSISTENT); + sdl->requests = emalloc(sizeof(HashTable)); + zend_hash_init(sdl->requests, i, NULL, NULL, 0); while (i > 0) { int function_num; @@ -1902,18 +1902,8 @@ sdlPtr get_sdl(char *uri TSRMLS_DC) { sdlPtr sdl = NULL; char* old_error_code = SOAP_GLOBAL(error_code); -#ifdef SDL_CACHE - sdlPtr *hndl; SOAP_GLOBAL(error_code) = "WSDL"; - if (zend_hash_find(SOAP_GLOBAL(sdls), uri, strlen(uri), (void **)&hndl) == FAILURE) { - sdl = load_wsdl(uri); - zend_hash_add(SOAP_GLOBAL(sdls), uri, strlen(uri), &sdl, sizeof(sdlPtr), NULL); - } else { - sdl = *hndl; - } -#else - SOAP_GLOBAL(error_code) = "WSDL"; if (SOAP_GLOBAL(cache_enabled)) { char fn[MAXPATHLEN]; @@ -1951,7 +1941,6 @@ sdlPtr get_sdl(char *uri TSRMLS_DC) } else { sdl = load_wsdl(uri); } -#endif SOAP_GLOBAL(error_code) = old_error_code; return sdl; } @@ -1963,36 +1952,36 @@ void delete_sdl(void *handle) zend_hash_destroy(&tmp->functions); if (tmp->source) { - sdl_free(tmp->source); + efree(tmp->source); } if (tmp->target_ns) { - sdl_free(tmp->target_ns); + efree(tmp->target_ns); } if (tmp->elements) { zend_hash_destroy(tmp->elements); - sdl_free(tmp->elements); + efree(tmp->elements); } if (tmp->encoders) { zend_hash_destroy(tmp->encoders); - sdl_free(tmp->encoders); + efree(tmp->encoders); } if (tmp->types) { zend_hash_destroy(tmp->types); - sdl_free(tmp->types); + efree(tmp->types); } if (tmp->groups) { zend_hash_destroy(tmp->groups); - sdl_free(tmp->groups); + efree(tmp->groups); } if (tmp->bindings) { zend_hash_destroy(tmp->bindings); - sdl_free(tmp->bindings); + efree(tmp->bindings); } if (tmp->requests) { zend_hash_destroy(tmp->requests); - sdl_free(tmp->requests); + efree(tmp->requests); } - sdl_free(tmp); + efree(tmp); } void delete_sdl_ptr(void *handle) @@ -2005,36 +1994,36 @@ static void delete_binding(void *data) sdlBindingPtr binding = *((sdlBindingPtr*)data); if (binding->location) { - sdl_free(binding->location); + efree(binding->location); } if (binding->name) { - sdl_free(binding->name); + efree(binding->name); } if (binding->bindingType == BINDING_SOAP) { sdlSoapBindingPtr soapBind = binding->bindingAttributes; if (soapBind && soapBind->transport) { - sdl_free(soapBind->transport); + efree(soapBind->transport); } - sdl_free(soapBind); + efree(soapBind); } - sdl_free(binding); + efree(binding); } static void delete_sdl_soap_binding_function_body(sdlSoapBindingFunctionBody body) { if (body.ns) { - sdl_free(body.ns); + efree(body.ns); } if (body.parts) { - sdl_free(body.parts); + efree(body.parts); } if (body.encodingStyle) { - sdl_free(body.encodingStyle); + efree(body.encodingStyle); } if (body.headers) { zend_hash_destroy(body.headers); - sdl_free(body.headers); + efree(body.headers); } } @@ -2043,58 +2032,58 @@ static void delete_function(void *data) sdlFunctionPtr function = *((sdlFunctionPtr*)data); if (function->functionName) { - sdl_free(function->functionName); + efree(function->functionName); } if (function->requestName) { - sdl_free(function->requestName); + efree(function->requestName); } if (function->responseName) { - sdl_free(function->responseName); + efree(function->responseName); } if (function->requestParameters) { zend_hash_destroy(function->requestParameters); - sdl_free(function->requestParameters); + efree(function->requestParameters); } if (function->responseParameters) { zend_hash_destroy(function->responseParameters); - sdl_free(function->responseParameters); + efree(function->responseParameters); } if (function->bindingAttributes && function->binding && function->binding->bindingType == BINDING_SOAP) { sdlSoapBindingFunctionPtr soapFunction = function->bindingAttributes; if (soapFunction->soapAction) { - sdl_free(soapFunction->soapAction); + efree(soapFunction->soapAction); } delete_sdl_soap_binding_function_body(soapFunction->input); delete_sdl_soap_binding_function_body(soapFunction->output); - sdl_free(soapFunction); + efree(soapFunction); } - sdl_free(function); + efree(function); } static void delete_parameter(void *data) { sdlParamPtr param = *((sdlParamPtr*)data); if (param->paramName) { - sdl_free(param->paramName); + efree(param->paramName); } - sdl_free(param); + efree(param); } static void delete_header(void *data) { sdlSoapBindingFunctionHeaderPtr hdr = *((sdlSoapBindingFunctionHeaderPtr*)data); if (hdr->name) { - sdl_free(hdr->name); + efree(hdr->name); } if (hdr->ns) { - sdl_free(hdr->ns); + efree(hdr->ns); } if (hdr->encodingStyle) { - sdl_free(hdr->encodingStyle); + efree(hdr->encodingStyle); } - sdl_free(hdr); + efree(hdr); } static void delete_document(void *doc_ptr) diff --git a/ext/soap/php_sdl.h b/ext/soap/php_sdl.h index 6b6d8cf59e..7b40f3ecef 100644 --- a/ext/soap/php_sdl.h +++ b/ext/soap/php_sdl.h @@ -22,18 +22,6 @@ #ifndef PHP_SDL_H #define PHP_SDL_H -#ifdef SDL_CACHE -# define SDL_PERSISTENT 1 -# define sdl_malloc malloc -# define sdl_strdup strdup -# define sdl_free free -#else -# define SDL_PERSISTENT 0 -# define sdl_malloc emalloc -# define sdl_strdup estrdup -# define sdl_free efree -#endif - #define XSD_WHITESPACE_COLLAPSE 1 #define XSD_WHITESPACE_PRESERVE 1 #define XSD_WHITESPACE_REPLACE 1 diff --git a/ext/soap/php_soap.h b/ext/soap/php_soap.h index 5b74760820..080279893f 100644 --- a/ext/soap/php_soap.h +++ b/ext/soap/php_soap.h @@ -142,7 +142,6 @@ ZEND_BEGIN_MODULE_GLOBALS(soap) HashTable defEncNs; /* mapping of default namespaces to prefixes */ HashTable defEnc; HashTable defEncIndex; - HashTable *sdls; HashTable *overrides; int cur_uniq_ns; int soap_version; diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 16ef01a29c..2a480e15a8 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -357,9 +357,6 @@ static void php_soap_init_globals(zend_soap_globals *soap_globals) int i; long enc; - soap_globals->sdls = malloc(sizeof(HashTable)); - zend_hash_init(soap_globals->sdls, 0, NULL, delete_sdl_ptr, 1); - zend_hash_init(&soap_globals->defEnc, 0, NULL, NULL, 1); zend_hash_init(&soap_globals->defEncIndex, 0, NULL, NULL, 1); zend_hash_init(&soap_globals->defEncNs, 0, NULL, NULL, 1); @@ -407,8 +404,6 @@ PHP_MSHUTDOWN_FUNCTION(soap) zend_hash_destroy(&SOAP_GLOBAL(defEnc)); zend_hash_destroy(&SOAP_GLOBAL(defEncIndex)); zend_hash_destroy(&SOAP_GLOBAL(defEncNs)); - zend_hash_destroy(SOAP_GLOBAL(sdls)); - free(SOAP_GLOBAL(sdls)); return SUCCESS; } @@ -487,11 +482,8 @@ PHP_MINIT_FUNCTION(soap) INIT_CLASS_ENTRY(ce, PHP_SOAP_HEADER_CLASSNAME, soap_header_functions); soap_header_class_entry = zend_register_internal_class(&ce TSRMLS_CC); -#ifdef SDL_CACHE - le_sdl = register_list_destructors(NULL, NULL); -#else + le_sdl = register_list_destructors(delete_sdl, NULL); -#endif le_url = register_list_destructors(delete_url, NULL); le_service = register_list_destructors(delete_service, NULL); @@ -952,7 +944,7 @@ PHP_FUNCTION(SoapServer,map) if (!service->mapping) { service->mapping = emalloc(sizeof(HashTable)); - zend_hash_init(service->mapping, 0, NULL, delete_tmp_encoder, 0); + zend_hash_init(service->mapping, 0, NULL, delete_encoder, 0); } zend_hash_update(service->mapping, type, type_len + 1, &new_enc, sizeof(encodePtr), NULL); smart_str_free(&resloved_ns); @@ -3440,10 +3432,8 @@ static void delete_service(void *data) if (service->uri) { efree(service->uri); } -#ifndef SDL_CACHE if (service->sdl) { delete_sdl(service->sdl); } -#endif efree(service); } |