tony2001 Mon Jan 19 14:41:53 2009 UTC
Modified files: (Branch: PHP_5_2)
/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.7&r2=1.31.2.2.2.8&diff_format=u
Index: php-src/ext/standard/scanf.c
diff -u php-src/ext/standard/scanf.c:1.31.2.2.2.7
php-src/ext/standard/scanf.c:1.31.2.2.2.8
--- php-src/ext/standard/scanf.c:1.31.2.2.2.7 Wed Dec 31 11:17:45 2008
+++ php-src/ext/standard/scanf.c Mon Jan 19 14:41:52 2009
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: scanf.c,v 1.31.2.2.2.7 2008/12/31 11:17:45 sebastian Exp $ */
+/* $Id: scanf.c,v 1.31.2.2.2.8 2009/01/19 14:41:52 tony2001 Exp $ */
/*
scanf.c --
@@ -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 );
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php