diff options
| author | Dmitry Stogov <dmitry@zend.com> | 2014-04-15 15:50:34 +0400 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@zend.com> | 2014-04-15 15:50:34 +0400 |
| commit | 61e9b0d265364f9b99a1fdc69a9cafd4d3fc4721 (patch) | |
| tree | 1d219c581e514495c928439d7290dbeb7c46543a | |
| parent | 050d7e38ad4163e7fa65e26724d3516ce7b33601 (diff) | |
| download | php-git-61e9b0d265364f9b99a1fdc69a9cafd4d3fc4721.tar.gz | |
Fixed memory leak
| -rw-r--r-- | ext/libxml/libxml.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index b0974b4020..705045eee4 100644 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -728,6 +728,10 @@ PHP_LIBXML_API void php_libxml_error_handler(void *ctx, const char *msg, ...) va_end(args); } +static void php_libxml_exports_dtor(zval *zv) +{ + free(Z_PTR_P(zv)); +} PHP_LIBXML_API void php_libxml_initialize(void) { @@ -738,7 +742,7 @@ PHP_LIBXML_API void php_libxml_initialize(void) _php_libxml_default_entity_loader = xmlGetExternalEntityLoader(); xmlSetExternalEntityLoader(_php_libxml_pre_ext_ent_loader); - zend_hash_init(&php_libxml_exports, 0, NULL, NULL, 1); + zend_hash_init(&php_libxml_exports, 0, NULL, php_libxml_exports_dtor, 1); _php_libxml_initialized = 1; } |
