diff options
author | Xinchen Hui <laruence@gmail.com> | 2014-03-03 16:13:03 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@gmail.com> | 2014-03-03 16:13:03 +0800 |
commit | 8ca824d6731cbbdf9414e10a61de5dc59d51cb96 (patch) | |
tree | b56775193acdc49a58ca1fc1eb5399695fe0d7fa | |
parent | e1d1be148ecf1b9a25fa60685eadc5f20061ae45 (diff) | |
download | php-git-8ca824d6731cbbdf9414e10a61de5dc59d51cb96.tar.gz |
Fixed memory leak
-rw-r--r-- | ext/standard/url.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/standard/url.c b/ext/standard/url.c index 1c02a1c437..33b70569ae 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -654,19 +654,19 @@ PHP_FUNCTION(rawurlencode) Decodes URL-encodes string */ PHP_FUNCTION(rawurldecode) { - char *in_str, *out_str; - int in_str_len, out_str_len; + char *in_str; + int in_str_len; + zend_string *out_str; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &in_str, &in_str_len) == FAILURE) { return; } - out_str = estrndup(in_str, in_str_len); - out_str_len = php_raw_url_decode(out_str, in_str_len); + out_str = STR_INIT(in_str, in_str_len, 0); + out_str->len = php_raw_url_decode(out_str->val, out_str->len); -//??? RETURN_STRINGL(out_str, out_str_len, 0); - RETURN_STRINGL(out_str, out_str_len); + RETURN_STR(out_str); } /* }}} */ |