summaryrefslogtreecommitdiff
path: root/ext/soap/php_schema.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2007-02-15 17:01:29 +0000
committerDmitry Stogov <dmitry@php.net>2007-02-15 17:01:29 +0000
commitea278e8566a9e32068747ed9f30579a3d6e40785 (patch)
tree625dc94da826afc1aa93fd5c41d1c40103b07d48 /ext/soap/php_schema.c
parent2cf92f365a8a010d9bc1f7fb86a1ad8e49d7a7a0 (diff)
downloadphp-git-ea278e8566a9e32068747ed9f30579a3d6e40785.tar.gz
Fixed memory leak
Diffstat (limited to 'ext/soap/php_schema.c')
-rw-r--r--ext/soap/php_schema.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/soap/php_schema.c b/ext/soap/php_schema.c
index fd66f3eed7..9ba4f81604 100644
--- a/ext/soap/php_schema.c
+++ b/ext/soap/php_schema.c
@@ -681,7 +681,9 @@ static int schema_restriction_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodeP
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_model_persistent(void *handle)
void delete_type(void *data)
{
sdlTypePtr type = *((sdlTypePtr*)data);
+
if (type->name) {
efree(type->name);
}