helly Sat Feb 3 14:57:25 2007 UTC Modified files: /php-src/main main.c php_open_temporary_file.c php_open_temporary_file.h Log: - Fix memleak http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.721&r2=1.722&diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.721 php-src/main/main.c:1.722 --- php-src/main/main.c:1.721 Wed Jan 24 21:43:47 2007 +++ php-src/main/main.c Sat Feb 3 14:57:24 2007 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: main.c,v 1.721 2007/01/24 21:43:47 pollita Exp $ */ +/* $Id: main.c,v 1.722 2007/02/03 14:57:24 helly Exp $ */ /* {{{ includes */ @@ -83,6 +83,7 @@ #include "php_ticks.h" #include "php_logos.h" #include "php_streams.h" +#include "php_open_temporary_file.h" #include "SAPI.h" #include "rfc1867.h" @@ -1852,6 +1853,7 @@ #endif php_output_shutdown(); + php_shutdown_temporary_directory(); module_initialized = 0; http://cvs.php.net/viewvc.cgi/php-src/main/php_open_temporary_file.c?r1=1.40&r2=1.41&diff_format=u Index: php-src/main/php_open_temporary_file.c diff -u php-src/main/php_open_temporary_file.c:1.40 php-src/main/php_open_temporary_file.c:1.41 --- php-src/main/php_open_temporary_file.c:1.40 Mon Jan 1 09:29:35 2007 +++ php-src/main/php_open_temporary_file.c Sat Feb 3 14:57:24 2007 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_open_temporary_file.c,v 1.40 2007/01/01 09:29:35 sebastian Exp $ */ +/* $Id: php_open_temporary_file.c,v 1.41 2007/02/03 14:57:24 helly Exp $ */ #include "php.h" @@ -148,14 +148,22 @@ } /* }}} */ +/* Cache the chosen temporary directory. */ +static char* temporary_directory; + +PHPAPI void php_shutdown_temporary_directory() +{ + if (temporary_directory) { + free(temporary_directory); + temporary_directory = NULL; + } +} + /* * Determine where to place temporary files. */ PHPAPI const char* php_get_temporary_directory(void) { - /* Cache the chosen temporary directory. */ - static char* temporary_directory; - /* Did we determine the temporary directory already? */ if (temporary_directory) { return temporary_directory; http://cvs.php.net/viewvc.cgi/php-src/main/php_open_temporary_file.h?r1=1.15&r2=1.16&diff_format=u Index: php-src/main/php_open_temporary_file.h diff -u php-src/main/php_open_temporary_file.h:1.15 php-src/main/php_open_temporary_file.h:1.16 --- php-src/main/php_open_temporary_file.h:1.15 Mon Jan 1 09:29:35 2007 +++ php-src/main/php_open_temporary_file.h Sat Feb 3 14:57:24 2007 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_open_temporary_file.h,v 1.15 2007/01/01 09:29:35 sebastian Exp $ */ +/* $Id: php_open_temporary_file.h,v 1.16 2007/02/03 14:57:24 helly Exp $ */ #ifndef PHP_OPEN_TEMPORARY_FILE_H #define PHP_OPEN_TEMPORARY_FILE_H @@ -25,6 +25,7 @@ PHPAPI FILE *php_open_temporary_file(const char *dir, const char *pfx, char **opened_path_p TSRMLS_DC); PHPAPI int php_open_temporary_fd(const char *dir, const char *pfx, char **opened_path_p TSRMLS_DC); PHPAPI const char *php_get_temporary_directory(void); +PHPAPI void php_shutdown_temporary_directory(); END_EXTERN_C() #endif /* PHP_OPEN_TEMPORARY_FILE_H */
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php