diff options
author | Derick Rethans <derick@php.net> | 2003-08-09 11:20:38 +0000 |
---|---|---|
committer | Derick Rethans <derick@php.net> | 2003-08-09 11:20:38 +0000 |
commit | e491d75df3a2455506fc00af0eb3e80240d6a43f (patch) | |
tree | 095b7d5d5e3b5d4dfe34b4659b416bc31d658c65 | |
parent | 66b910e87c9b2959fef1997a7ee8d7f691d4e074 (diff) | |
download | php-git-e491d75df3a2455506fc00af0eb3e80240d6a43f.tar.gz |
- Fix memleak (this strndup is totally unnecessary)
-rw-r--r-- | ext/zlib/zlib.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 5e7ae13280..c745cec3b0 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -349,13 +349,11 @@ PHP_FUNCTION(gzopen) convert_to_string_ex(arg1); convert_to_string_ex(arg2); - p = estrndup(Z_STRVAL_PP(arg2), Z_STRLEN_PP(arg2)); - - stream = php_stream_gzopen(NULL, Z_STRVAL_PP(arg1), p, use_include_path | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, NULL STREAMS_CC TSRMLS_CC); + stream = php_stream_gzopen(NULL, Z_STRVAL_PP(arg1), Z_STRVAL_PP(arg2), use_include_path | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, NULL STREAMS_CC TSRMLS_CC); + if (!stream) { RETURN_FALSE; } - efree(p); php_stream_to_zval(stream, return_value); } /* }}} */ |