]> granicus.if.org Git - php/commitdiff
save a few memory
authorRemi Collet <remi@php.net>
Thu, 19 Dec 2013 09:55:26 +0000 (10:55 +0100)
committerRemi Collet <remi@php.net>
Thu, 19 Dec 2013 09:55:26 +0000 (10:55 +0100)
ext/zip/php_zip.c

index dc30c3ed5cfba885762df2b758a7bc9882081e91..5e7d99b7552fc859c68793ae6090ab9fdac7a3d9 100644 (file)
@@ -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;