summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli_api.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2014-08-13 15:51:43 +0800
committerXinchen Hui <laruence@php.net>2014-08-13 15:51:43 +0800
commitda3aeeed39f24e34e9318d7123ff84f0c5a98e61 (patch)
tree422cc176cbd624f5c4dcd78e66e3403b095ec7b8 /ext/mysqli/mysqli_api.c
parent05eaed43453bf74144bc6115db641e9e8a41d568 (diff)
downloadphp-git-da3aeeed39f24e34e9318d7123ff84f0c5a98e61.tar.gz
clean up - avoid realloc
Diffstat (limited to 'ext/mysqli/mysqli_api.c')
-rw-r--r--ext/mysqli/mysqli_api.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index 195eb41b5c..19f12417fe 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -2262,9 +2262,10 @@ PHP_FUNCTION(mysqli_stat)
{
MY_MYSQL *mysql;
zval *mysql_link;
- char *stat;
#if defined(MYSQLI_USE_MYSQLND)
- uint stat_len;
+ zend_string *stat;
+#else
+ char *stat;
#endif
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
@@ -2277,10 +2278,9 @@ PHP_FUNCTION(mysqli_stat)
{
RETURN_STRING(stat);
#else
- if (mysqlnd_stat(mysql->mysql, &stat, &stat_len) == PASS)
+ if (mysqlnd_stat(mysql->mysql, &stat) == PASS)
{
- RETVAL_STRINGL(stat, stat_len);
- efree(stat);
+ RETURN_STR(stat);
#endif
} else {
RETURN_FALSE;