--- embedaddon/php/ext/soap/php_sdl.c 2013/07/22 01:32:01 1.1.1.3 +++ embedaddon/php/ext/soap/php_sdl.c 2014/06/15 20:03:55 1.1.1.4 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ | Dmitry Stogov | +----------------------------------------------------------------------+ */ -/* $Id: php_sdl.c,v 1.1.1.3 2013/07/22 01:32:01 misho Exp $ */ +/* $Id: php_sdl.c,v 1.1.1.4 2014/06/15 20:03:55 misho Exp $ */ #include "php_soap.h" #include "ext/libxml/php_libxml.h" @@ -2644,16 +2644,17 @@ static sdlAttributePtr make_persistent_sdl_attribute(s 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); }