dmitry Thu Feb 15 17:00:53 2007 UTC
Modified files:
/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.69&r2=1.70&diff_format=u
Index: php-src/ext/soap/php_schema.c
diff -u php-src/ext/soap/php_schema.c:1.69 php-src/ext/soap/php_schema.c:1.70
--- php-src/ext/soap/php_schema.c:1.69 Mon Jan 1 09:29:29 2007
+++ php-src/ext/soap/php_schema.c Thu Feb 15 17:00:52 2007
@@ -17,7 +17,7 @@
| Dmitry Stogov <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_schema.c,v 1.69 2007/01/01 09:29:29 sebastian Exp $ */
+/* $Id: php_schema.c,v 1.70 2007/02/15 17:00:52 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