summaryrefslogtreecommitdiff
path: root/ext/soap/php_sdl.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2006-04-18 13:07:59 +0000
committerDmitry Stogov <dmitry@php.net>2006-04-18 13:07:59 +0000
commit349bcd744336b3da8e04b5bef3b0e8ffdaaddc1a (patch)
treefc03308cef52c6fb966ac8a35bae9adb356ce24d /ext/soap/php_sdl.c
parentd19c1058195e2571b55f56fd40c2f4efe0051e72 (diff)
downloadphp-git-349bcd744336b3da8e04b5bef3b0e8ffdaaddc1a.tar.gz
Fixed bug #37083 (Frequent crashs in SOAP extension with new WSDL caching code in multithread WS). (Andrei, Dmitry)
Diffstat (limited to 'ext/soap/php_sdl.c')
-rw-r--r--ext/soap/php_sdl.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c
index ba7fa5ad57..3d09b6bbc0 100644
--- a/ext/soap/php_sdl.c
+++ b/ext/soap/php_sdl.c
@@ -143,13 +143,18 @@ encodePtr get_encoder(sdlPtr sdl, const char *ns, const char *type)
enc = get_encoder_ex(NULL, enc_nscat, enc_len);
efree(enc_nscat);
if (enc && sdl) {
- encodePtr new_enc = emalloc(sizeof(encode));
+ encodePtr new_enc = pemalloc(sizeof(encode), sdl->is_persistent);
memcpy(new_enc, enc, sizeof(encode));
- new_enc->details.ns = estrndup(ns, ns_len);
- new_enc->details.type_str = estrdup(new_enc->details.type_str);
+ if (sdl->is_persistent) {
+ new_enc->details.ns = zend_strndup(ns, ns_len);
+ new_enc->details.type_str = strdup(new_enc->details.type_str);
+ } else {
+ new_enc->details.ns = estrndup(ns, ns_len);
+ new_enc->details.type_str = estrdup(new_enc->details.type_str);
+ }
if (sdl->encoders == NULL) {
- sdl->encoders = emalloc(sizeof(HashTable));
- zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, 0);
+ sdl->encoders = pemalloc(sizeof(HashTable), sdl->is_persistent);
+ zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, sdl->is_persistent);
}
zend_hash_update(sdl->encoders, nscat, len + 1, &new_enc, sizeof(encodePtr), NULL);
enc = new_enc;