dmitry Thu Feb 15 17:01:29 2007 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/soap php_schema.c
Log:
Fixed memory leak
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_schema.c?r1=1.58.2.6.2.4&r2=1.58.2.6.2.5&diff_format=u
Index: php-src/ext/soap/php_schema.c
diff -u php-src/ext/soap/php_schema.c:1.58.2.6.2.4
php-src/ext/soap/php_schema.c:1.58.2.6.2.5
--- php-src/ext/soap/php_schema.c:1.58.2.6.2.4 Mon Jan 1 09:36:06 2007
+++ php-src/ext/soap/php_schema.c Thu Feb 15 17:01:29 2007
@@ -17,7 +17,7 @@
| Dmitry Stogov <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_schema.c,v 1.58.2.6.2.4 2007/01/01 09:36:06 sebastian Exp $ */
+/* $Id: php_schema.c,v 1.58.2.6.2.5 2007/02/15 17:01:29 dmitry Exp $ */
#include "php_soap.h"
#include "libxml/uri.h"
@@ -681,7 +681,9 @@
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);
+ if (zend_hash_add(cur_type->restrictions->enumeration,
enumval->value, strlen(enumval->value)+1, &enumval,
sizeof(sdlRestrictionCharPtr), NULL) == FAILURE) {
+ delete_restriction_var_char(&enumval);
+ }
} else {
break;
}
@@ -2313,6 +2315,7 @@
void delete_type(void *data)
{
sdlTypePtr type = *((sdlTypePtr*)data);
+
if (type->name) {
efree(type->name);
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php