summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerick Rethans <derick@php.net>2003-08-09 11:20:38 +0000
committerDerick Rethans <derick@php.net>2003-08-09 11:20:38 +0000
commite491d75df3a2455506fc00af0eb3e80240d6a43f (patch)
tree095b7d5d5e3b5d4dfe34b4659b416bc31d658c65
parent66b910e87c9b2959fef1997a7ee8d7f691d4e074 (diff)
downloadphp-git-e491d75df3a2455506fc00af0eb3e80240d6a43f.tar.gz
- Fix memleak (this strndup is totally unnecessary)
-rw-r--r--ext/zlib/zlib.c6
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);
}
/* }}} */