diff options
author | Sterling Hughes <sterling@php.net> | 2001-06-24 17:50:16 +0000 |
---|---|---|
committer | Sterling Hughes <sterling@php.net> | 2001-06-24 17:50:16 +0000 |
commit | 35a816ce5fc169c7462afe3c57fac1ae18464539 (patch) | |
tree | 07aff96cf6592c0490a2d2c7c32de046e52366b1 | |
parent | 242b8af6aa1a564d883296070d7895fb1960c79f (diff) | |
download | php-git-35a816ce5fc169c7462afe3c57fac1ae18464539.tar.gz |
Hopefully fix leaks...
-rw-r--r-- | ext/sablot/sablot.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/ext/sablot/sablot.c b/ext/sablot/sablot.c index dbe3fcc873..f2797eff82 100644 --- a/ext/sablot/sablot.c +++ b/ext/sablot/sablot.c @@ -80,14 +80,18 @@ static zval *_php_sablot_resource_zval(long); /* ERROR Macros */ #define SABLOT_FREE_ERROR_HANDLE(__handle) \ - if ((__handle).errors) { \ - (__handle).errors = (__handle).errors_start.next; \ - while ((__handle).errors) { \ - S_FREE((__handle).errors->key); \ - S_FREE((__handle).errors->value); \ - (__handle).errors = (__handle).errors->next; \ + if ((__handle).errors) { \ + struct _php_sablot_error *current = (__handle).errors; \ + struct _php_sablot_error *next; \ + \ + current = (__handle).errors_start.next; \ + while (current != NULL) { \ + next = current->next; \ + S_FREE(current->key); \ + S_FREE(current->value); \ + S_FREE(current); \ + current = next; \ } \ - S_FREE((__handle).errors); \ } @@ -542,19 +546,21 @@ PHP_FUNCTION(xslt_process) RETURN_FALSE; } - SablotGetResultArg(SABLOT_BASIC_HANDLE, "arg:/_output", &tRes); + ret = SablotGetResultArg(SABLOT_BASIC_HANDLE, "arg:/_output", &tRes); if (ret) { SABLOTG(last_errno) = ret; - RETURN_FALSE; if (tRes) SablotFree(tRes); + + RETURN_FALSE; } if (tRes) { ZVAL_STRING(*result, tRes, 1); SablotFree(tRes); } + RETURN_TRUE; } /* }}} */ |