]> granicus.if.org Git - php/commitdiff
modified code freeing resouce which causes segmentation fault.
authorRui Hirokawa <hirokawa@php.net>
Sun, 10 Jun 2001 09:41:43 +0000 (09:41 +0000)
committerRui Hirokawa <hirokawa@php.net>
Sun, 10 Jun 2001 09:41:43 +0000 (09:41 +0000)
ext/xslt/php_sablot.h
ext/xslt/sablot.c

index 1c63c681544d1fd52bfdd1549445ee944e01e418..f494fba8489f87b5c1df33854ba8fde10980abed 100644 (file)
@@ -46,6 +46,8 @@ extern zend_module_entry xslt_module_entry;
 #define XSLT_ERRSTR(handle)    ((handle)->err->str)
 #define XSLT_LOG(handle)       ((handle)->err->log)
 
+#define XSLT_FUNCH_FREE(__var) if (__var) zval_ptr_dtor(&(__var)); 
+
 PHP_MINIT_FUNCTION(xslt);
 PHP_MINFO_FUNCTION(xslt);
 
index 28d8c245e42ea03d54742ed0512da9a26e124220..1b46eec981ab48068aaf7f6924f019fd0c925962 100644 (file)
@@ -609,23 +609,23 @@ static void free_processor(zend_rsrc_list_entry *rsrc)
        }
 
        /* Free Scheme handlers */
-       zval_ptr_dtor(&XSLT_SCHEME(handle).get_all);
-       zval_ptr_dtor(&XSLT_SCHEME(handle).open);
-       zval_ptr_dtor(&XSLT_SCHEME(handle).get);
-       zval_ptr_dtor(&XSLT_SCHEME(handle).put);
-       zval_ptr_dtor(&XSLT_SCHEME(handle).close);
+       XSLT_FUNCH_FREE(XSLT_SCHEME(handle).get_all);
+       XSLT_FUNCH_FREE(XSLT_SCHEME(handle).open);
+       XSLT_FUNCH_FREE(XSLT_SCHEME(handle).get);
+       XSLT_FUNCH_FREE(XSLT_SCHEME(handle).put);
+       XSLT_FUNCH_FREE(XSLT_SCHEME(handle).close);
        /* Free SAX handlers */
-       zval_ptr_dtor(&XSLT_SAX(handle).doc_start);
-       zval_ptr_dtor(&XSLT_SAX(handle).element_start);
-       zval_ptr_dtor(&XSLT_SAX(handle).element_end);
-       zval_ptr_dtor(&XSLT_SAX(handle).namespace_start);
-       zval_ptr_dtor(&XSLT_SAX(handle).namespace_end);
-       zval_ptr_dtor(&XSLT_SAX(handle).comment);
-       zval_ptr_dtor(&XSLT_SAX(handle).pi);
-       zval_ptr_dtor(&XSLT_SAX(handle).characters);
-       zval_ptr_dtor(&XSLT_SAX(handle).doc_end);
+       XSLT_FUNCH_FREE(XSLT_SAX(handle).doc_start);
+       XSLT_FUNCH_FREE(XSLT_SAX(handle).element_start);
+       XSLT_FUNCH_FREE(XSLT_SAX(handle).element_end);
+       XSLT_FUNCH_FREE(XSLT_SAX(handle).namespace_start);
+       XSLT_FUNCH_FREE(XSLT_SAX(handle).namespace_end);
+       XSLT_FUNCH_FREE(XSLT_SAX(handle).comment);
+       XSLT_FUNCH_FREE(XSLT_SAX(handle).pi);
+       XSLT_FUNCH_FREE(XSLT_SAX(handle).characters);
+       XSLT_FUNCH_FREE(XSLT_SAX(handle).doc_end);
        /* Free error handler */
-       zval_ptr_dtor(&XSLT_ERROR(handle));
+       XSLT_FUNCH_FREE(XSLT_ERROR(handle));
 
        /* Free error message, if any */
        if (XSLT_ERRSTR(handle)) {