diff options
author | Felipe Pena <felipensp@gmail.com> | 2013-10-19 23:36:41 -0300 |
---|---|---|
committer | Felipe Pena <felipensp@gmail.com> | 2013-10-19 23:36:41 -0300 |
commit | 39e746a4249e34bc9028ff5d7540cd344181293d (patch) | |
tree | c9d07cb02429fd234ee56c495c3ad2e6546aac9a | |
parent | 07361a4efc6b187cf186ccf330719eb419ef723b (diff) | |
parent | 0b5c2887cdf2d9c8d9c466de88d898c30cea2d38 (diff) | |
download | php-git-39e746a4249e34bc9028ff5d7540cd344181293d.tar.gz |
Merge branch 'PHP-5.5'
* PHP-5.5:
- Moved allocation to if block to make Coverity happy
-rw-r--r-- | ext/soap/php_sdl.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index 0ac4c2ed7a..a7a5071c08 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -2644,16 +2644,17 @@ static sdlAttributePtr make_persistent_sdl_attribute(sdlAttributePtr attr, HashT zend_hash_internal_pointer_reset(pattr->extraAttributes); while (zend_hash_get_current_data(attr->extraAttributes, (void**)&tmp) == SUCCESS) { - pextra = malloc(sizeof(sdlExtraAttribute)); - memset(pextra, 0, sizeof(sdlExtraAttribute)); - if ((*tmp)->ns) { - pextra->ns = strdup((*tmp)->ns); - } - if ((*tmp)->val) { - pextra->val = strdup((*tmp)->val); - } + if (zend_hash_get_current_key_ex(attr->extraAttributes, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) { + pextra = malloc(sizeof(sdlExtraAttribute)); + memset(pextra, 0, sizeof(sdlExtraAttribute)); - if (zend_hash_get_current_key_ex(attr->extraAttributes, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) { + if ((*tmp)->ns) { + pextra->ns = strdup((*tmp)->ns); + } + if ((*tmp)->val) { + pextra->val = strdup((*tmp)->val); + } + zend_hash_add(pattr->extraAttributes, key, key_len, (void*)&pextra, sizeof(sdlExtraAttributePtr), NULL); } |