cvs: php4 /ext/sablot sablot.c

From: Date: Sun, 24 Jun 2001 17:50:16 +0000
Subject: cvs: php4 /ext/sablot sablot.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-6000@lists.php.net to get a copy of this message
sterling Sun Jun 24 19:50:16 2001 EDT Modified files: /php4/ext/sablot sablot.c Log: Hopefully fix leaks... Index: php4/ext/sablot/sablot.c diff -u php4/ext/sablot/sablot.c:1.39 php4/ext/sablot/sablot.c:1.40 --- php4/ext/sablot/sablot.c:1.39 Thu May 24 12:07:23 2001 +++ php4/ext/sablot/sablot.c Sun Jun 24 19:50:16 2001 @@ -80,14 +80,18 @@ /* 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 @@ 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; } /* }}} */

« previous php.cvs (#6000) next »