cvs: TSRM / TSRM.c tsrm_virtual_cwd.c

From: Date: Tue, 07 Jan 2003 12:11:41 +0000
Subject: cvs: TSRM / TSRM.c tsrm_virtual_cwd.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-759@lists.php.net to get a copy of this message
zeev Tue Jan 7 07:11:41 2003 EDT Modified files: /TSRM TSRM.c tsrm_virtual_cwd.c Log: Fix leaks Index: TSRM/TSRM.c diff -u TSRM/TSRM.c:1.49 TSRM/TSRM.c:1.50 --- TSRM/TSRM.c:1.49 Tue Jan 7 05:33:22 2003 +++ TSRM/TSRM.c Tue Jan 7 07:11:40 2003 @@ -508,6 +508,7 @@ if (mutexp) { #ifdef TSRM_WIN32 DeleteCriticalSection(mutexp); + free(mutexp); #elif defined(NETWARE) #ifdef USE_MPK kMutexFree(mutexp); Index: TSRM/tsrm_virtual_cwd.c diff -u TSRM/tsrm_virtual_cwd.c:1.44 TSRM/tsrm_virtual_cwd.c:1.45 --- TSRM/tsrm_virtual_cwd.c:1.44 Thu Jan 2 09:29:00 2003 +++ TSRM/tsrm_virtual_cwd.c Tue Jan 7 07:11:40 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: tsrm_virtual_cwd.c,v 1.44 2003/01/02 14:29:00 hyanantha Exp $ */ +/* $Id: tsrm_virtual_cwd.c,v 1.45 2003/01/07 12:11:40 zeev Exp $ */ #include <sys/types.h> #include <sys/stat.h> @@ -474,19 +474,23 @@ CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC) { cwd_state new_state; - int retval; + char *retval; CWD_STATE_COPY(&new_state, &CWDG(cwd)); - retval = virtual_file_ex(&new_state, path, NULL, 1); - if (!retval) { + if (virtual_file_ex(&new_state, path, NULL, 1)==0) { int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length; + memcpy(real_path, new_state.cwd, len); real_path[len] = '\0'; - return real_path; + retval = real_path; + } else { + retval = NULL; } - return NULL; + CWD_STATE_FREE(&new_state); + + return retval; } CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path TSRMLS_DC)

« previous php.zend-engine.cvs (#759) next »