diff options
author | Felipe Pena <felipensp@gmail.com> | 2013-10-19 23:36:36 -0300 |
---|---|---|
committer | Felipe Pena <felipensp@gmail.com> | 2013-10-19 23:36:36 -0300 |
commit | 0b5c2887cdf2d9c8d9c466de88d898c30cea2d38 (patch) | |
tree | 81fe3a73390417470ae866f9809ff5627ef30a6a /ext/soap | |
parent | c1f22176f3cc3653fb140312456fd8c55b0efddc (diff) | |
parent | 85a622e42f815c3a62008eff21ec4ab259906e7e (diff) | |
download | php-git-0b5c2887cdf2d9c8d9c466de88d898c30cea2d38.tar.gz |
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
- Moved allocation to if block to make Coverity happy
Diffstat (limited to 'ext/soap')
-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); } |