]> granicus.if.org Git - php/commitdiff
use strdup()
authorAntony Dovgal <tony2001@php.net>
Tue, 6 Feb 2007 17:35:42 +0000 (17:35 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 6 Feb 2007 17:35:42 +0000 (17:35 +0000)
main/php_open_temporary_file.c

index c59d8e6407777888fc623c4a3699f2a8e8b41bdc..c7f78ac7c2a18e41a58763e1caedc4d3fb6f7cb5 100644 (file)
@@ -194,12 +194,12 @@ PHPAPI const char* php_get_temporary_directory(void)
 #ifdef P_tmpdir
        /* Use the standard default temporary directory. */
        if (P_tmpdir) {
-               temporary_directory = P_tmpdir;
+               temporary_directory = strdup(P_tmpdir);
                return temporary_directory;
        }
 #endif
        /* Shouldn't ever(!) end up here ... last ditch default. */
-       temporary_directory = "/tmp";
+       temporary_directory = strdup("/tmp");
        return temporary_directory;
 #endif
 }