]> granicus.if.org Git - php/commitdiff
Fixed memory leak
authorDmitry Stogov <dmitry@php.net>
Thu, 15 Feb 2007 17:01:29 +0000 (17:01 +0000)
committerDmitry Stogov <dmitry@php.net>
Thu, 15 Feb 2007 17:01:29 +0000 (17:01 +0000)
ext/soap/php_schema.c

index fd66f3eed798d11d53dd5d97f26002991d2dedb3..9ba4f81604668b68e5795ad58af1a1cdc4e1baad 100644 (file)
@@ -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);
        }