]> granicus.if.org Git - php/commitdiff
- This should be more efficient.
authorAndi Gutmans <andi@php.net>
Sun, 27 Aug 2000 19:20:53 +0000 (19:20 +0000)
committerAndi Gutmans <andi@php.net>
Sun, 27 Aug 2000 19:20:53 +0000 (19:20 +0000)
- Post 4.0.2 it's time to move the whole opened_path and virtual stuff
- to emalloc() and friends including some alloca() improvements where
- possible but I don't want to break anything before

main/php_virtual_cwd.c

index 054be6d044c27d1006f5505dde82428574131f38..6de1764033b4272322d5c724ddd6aa1a3fea9e7a 100644 (file)
@@ -416,14 +416,14 @@ CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path
        if (length == COPY_WHEN_ABSOLUTE && IS_ABSOLUTE_PATH(path, length+1)) { /* Also use trailing slash if this is absolute */
                length++;
        }
-       temp = (char *) malloc(length+1);
+       temp = (char *) do_alloca(length+1);
        memcpy(temp, path, length);
        temp[length] = 0;
 #if VIRTUAL_CWD_DEBUG
        fprintf (stderr, "Changing directory to %s\n", temp);
 #endif
        retval = p_chdir(temp);
-       free(temp);
+       free_alloca(temp);
        return retval;
 }