summaryrefslogtreecommitdiff
path: root/ext/standard/cyr_convert.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2014-02-24 15:03:35 +0800
committerXinchen Hui <laruence@gmail.com>2014-02-24 15:03:35 +0800
commit6f6573ef6aebeafd3282191cf4e250a6df675791 (patch)
tree2516ba1e41d7d42f7702ab86ba86b93b5a29a9a2 /ext/standard/cyr_convert.c
parent077b02326a22d14f4970ffc3770e2a85f0728fb0 (diff)
downloadphp-git-6f6573ef6aebeafd3282191cf4e250a6df675791.tar.gz
Fixed several memory leaks
Diffstat (limited to 'ext/standard/cyr_convert.c')
-rw-r--r--ext/standard/cyr_convert.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/ext/standard/cyr_convert.c b/ext/standard/cyr_convert.c
index bc482367af..280aba5cec 100644
--- a/ext/standard/cyr_convert.c
+++ b/ext/standard/cyr_convert.c
@@ -273,17 +273,16 @@ PHP_FUNCTION(convert_cyr_string)
{
char *input, *fr_cs, *to_cs;
int input_len, fr_cs_len, to_cs_len;
- unsigned char *str;
+ zend_string *str;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss", &input, &input_len, &fr_cs, &fr_cs_len, &to_cs, &to_cs_len) == FAILURE) {
return;
}
- str = (unsigned char*) estrndup(input, input_len);
+ str = STR_INIT(input, input_len, 0);
- php_convert_cyr_string(str, input_len, fr_cs[0], to_cs[0] TSRMLS_CC);
-//??? RETVAL_STRING((char *)str, 0);
- RETVAL_STRING((char *)str);
+ php_convert_cyr_string(str->val, str->len, fr_cs[0], to_cs[0] TSRMLS_CC);
+ RETVAL_STR(str);
}
/* }}} */