summaryrefslogtreecommitdiff
path: root/ext/zip/php_zip.c
diff options
context:
space:
mode:
authorRemi Collet <remi@php.net>2013-12-19 10:55:26 +0100
committerRemi Collet <remi@php.net>2013-12-19 10:55:26 +0100
commitf6ffecbd2d2a12a9d8d6c411af6ff1561a9f0882 (patch)
treeddb3ffb783c4f1b264701adff13a605788c29fde /ext/zip/php_zip.c
parent99b91f98b11c7279f8312506bd556f4c3e1e7fea (diff)
downloadphp-git-f6ffecbd2d2a12a9d8d6c411af6ff1561a9f0882.tar.gz
save a few memory
Diffstat (limited to 'ext/zip/php_zip.c')
-rw-r--r--ext/zip/php_zip.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index dc30c3ed5c..5e7d99b755 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -1510,7 +1510,7 @@ static ZIPARCHIVE_METHOD(open)
int filename_len;
int err = 0;
long flags = 0;
- char resolved_path[MAXPATHLEN];
+ char *resolved_path;
zval *this = getThis();
ze_zip_object *ze_obj = NULL;
@@ -1533,7 +1533,7 @@ static ZIPARCHIVE_METHOD(open)
RETURN_FALSE;
}
- if (!expand_filepath(filename, resolved_path TSRMLS_CC)) {
+ if (!(resolved_path = expand_filepath(filename, NULL TSRMLS_CC))) {
RETURN_FALSE;
}
@@ -1554,7 +1554,7 @@ static ZIPARCHIVE_METHOD(open)
if (!intern || err) {
RETURN_LONG((long)err);
}
- ze_obj->filename = estrdup(resolved_path);
+ ze_obj->filename = resolved_path;
ze_obj->filename_len = strlen(resolved_path);
ze_obj->za = intern;
RETURN_TRUE;