cvs: php4 /ext/mbstring mbfilter.c mbstring.c
| From: | Rui Hirokawa | Date: | Fri, 04 May 2001 10:42:56 +0000 |
| Subject: | cvs: php4 /ext/mbstring mbfilter.c mbstring.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-5524@lists.php.net to get a copy of this message | ||
hirokawa Fri May 4 03:42:56 2001 EDT
Modified files:
/php4/ext/mbstring mbfilter.c mbstring.c
Log:
fixed a memory leak in ext/mbstring.
Index: php4/ext/mbstring/mbfilter.c
diff -u php4/ext/mbstring/mbfilter.c:1.1 php4/ext/mbstring/mbfilter.c:1.2
--- php4/ext/mbstring/mbfilter.c:1.1 Mon Apr 30 18:48:50 2001
+++ php4/ext/mbstring/mbfilter.c Fri May 4 03:42:54 2001
@@ -74,7 +74,7 @@
*
*/
-/* $Id: mbfilter.c,v 1.1 2001/05/01 01:48:50 hirokawa Exp $ */
+/* $Id: mbfilter.c,v 1.2 2001/05/04 10:42:54 hirokawa Exp $ */
#include <stdlib.h>
@@ -2279,12 +2279,16 @@
static int
mbfl_filt_conv_common_flush(mbfl_convert_filter *filter)
{
+ filter->status = 0;
+ filter->cache = 0;
return 0;
}
static void
mbfl_filt_conv_common_dtor(mbfl_convert_filter *filter)
{
+ filter->status = 0;
+ filter->cache = 0;
}
static int
Index: php4/ext/mbstring/mbstring.c
diff -u php4/ext/mbstring/mbstring.c:1.6 php4/ext/mbstring/mbstring.c:1.7
--- php4/ext/mbstring/mbstring.c:1.6 Wed May 2 17:44:26 2001
+++ php4/ext/mbstring/mbstring.c Fri May 4 03:42:54 2001
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mbstring.c,v 1.6 2001/05/03 00:44:26 hirokawa Exp $ */
+/* $Id: mbstring.c,v 1.7 2001/05/04 10:42:54 hirokawa Exp $ */
/*
* PHP4 Multibyte String module "mbstring" (currently only for Japanese)
@@ -51,6 +51,7 @@
#include "ext/standard/php_mail.h"
#include "ext/standard/url.h"
#include "ext/standard/php_output.h"
+#include "ext/standard/info.h"
#include "php_variables.h"
#include "php_globals.h"
@@ -763,8 +764,10 @@
}
/* }}} */
+#if defined(MBSTR_ENC_TRANS)
+static void
+php_mbstr_encoding_handler(zval *arg, char *res, char *separator) {
-static php_mbstr_encoding_handler(zval *arg, char *res, char *separator) {
char *var, *val;
char *strtok_buf = NULL, **val_list;
zval *array_ptr = (zval *) arg;
@@ -875,6 +878,7 @@
}
if (ret != NULL) {
php_register_variable_safe(val_list[n], ret->val, ret->len, array_ptr ELS_CC PLS_CC);
+ efree(ret->val);
} else {
php_register_variable_safe(val_list[n], val_list[n+1], len_list[n+1], array_ptr ELS_CC PLS_CC);
}
@@ -1023,6 +1027,7 @@
efree(res);
}
}
+#endif
/* {{{ proto array mb_gpc_handler(string query, int type)
*/