cvs: php-src(PHP_5_3) /ext/standard scanf.c
| From: | Antony Dovgal | Date: | Mon, 19 Jan 2009 09:52:24 +0000 |
| Subject: | cvs: php-src(PHP_5_3) /ext/standard scanf.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-55743@lists.php.net to get a copy of this message | ||
tony2001 Mon Jan 19 09:52:24 2009 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/standard scanf.c
Log:
MFH: fix memleaks in sscanf()
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/scanf.c?r1=1.31.2.2.2.5.2.3&r2=1.31.2.2.2.5.2.4&diff_format=u
Index: php-src/ext/standard/scanf.c
diff -u php-src/ext/standard/scanf.c:1.31.2.2.2.5.2.3 php-src/ext/standard/scanf.c:1.31.2.2.2.5.2.4
--- php-src/ext/standard/scanf.c:1.31.2.2.2.5.2.3 Wed Dec 31 11:15:45 2008
+++ php-src/ext/standard/scanf.c Mon Jan 19 09:52:24 2009
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: scanf.c,v 1.31.2.2.2.5.2.3 2008/12/31 11:15:45 sebastian Exp $ */
+/* $Id: scanf.c,v 1.31.2.2.2.5.2.4 2009/01/19 09:52:24 tony2001 Exp $ */
/*
scanf.c --
@@ -934,7 +934,7 @@
__buf[0] = sch;
__buf[1] = '\0';;
current = args[objIndex++];
- convert_to_string_ex( current );
+ zval_dtor(*current);
ZVAL_STRINGL( *current, __buf, 1, 1);
} else {
add_index_stringl(*return_value, objIndex++, &sch, 1, 1);
@@ -1066,9 +1066,9 @@
break;
} else if (numVars) {
/* change passed value type to string */
- current = args[objIndex++];
- convert_to_string( *current );
- ZVAL_STRING( *current, buf, 1 );
+ current = args[objIndex++];
+ zval_dtor(*current);
+ ZVAL_STRING( *current, buf, 1 );
} else {
add_index_string(*return_value, objIndex++, buf, 1);
}
@@ -1077,7 +1077,7 @@
break;
} else if (numVars) {
current = args[objIndex++];
- convert_to_long( *current );
+ zval_dtor(*current);
Z_LVAL(**current) = value;
} else {
add_index_long(*return_value, objIndex++, value);
@@ -1182,7 +1182,7 @@
break;
} else if (numVars) {
current = args[objIndex++];
- convert_to_double( *current );
+ zval_dtor(*current);
Z_DVAL_PP( current ) = dvalue;
} else {
add_index_double( *return_value, objIndex++, dvalue );