summaryrefslogtreecommitdiff
path: root/ext/mysql/php_mysql.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mysql/php_mysql.c')
-rw-r--r--ext/mysql/php_mysql.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index a9c789fa53..cf81a63cf3 100644
--- a/ext/mysql/php_mysql.c
+++ b/ext/mysql/php_mysql.c
@@ -1625,7 +1625,7 @@ PHP_FUNCTION(mysql_real_escape_string)
new_str = emalloc(str_len * 2 + 1);
new_str_len = mysql_real_escape_string(&mysql->conn, new_str, str, str_len);
- new_str = erealloc(new_str, new_str_len);
+ new_str = erealloc(new_str, new_str_len + 1);
RETURN_STRINGL(new_str, new_str_len, 0);
}