Skip to content

Commit 51e1da6

Browse files
committed
exclude debug code
1 parent 6b6122a commit 51e1da6

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Zend/zend_virtual_cwd.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,10 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
913913
int bufindex = 0, isabsolute = 0;
914914
wchar_t * reparsetarget;
915915
BOOL isVolume = FALSE;
916-
char *printname = NULL, *substitutename = NULL;
916+
#if VIRTUAL_CWD_DEBUG
917+
char *printname = NULL;
918+
#endif
919+
char *substitutename = NULL;
917920
size_t substitutename_len;
918921
int substitutename_off = 0;
919922
wchar_t tmpsubstname[MAXPATHLEN];
@@ -951,13 +954,15 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
951954
if(pbuffer->ReparseTag == IO_REPARSE_TAG_SYMLINK) {
952955
reparsetarget = pbuffer->SymbolicLinkReparseBuffer.ReparseTarget;
953956
isabsolute = (pbuffer->SymbolicLinkReparseBuffer.Flags == 0) ? 1 : 0;
957+
#if VIRTUAL_CWD_DEBUG
954958
printname = php_win32_ioutil_w_to_any(reparsetarget + pbuffer->MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR));
955959
if (!printname) {
956960
free_alloca(pbuffer, use_heap_large);
957961
free_alloca(tmp, use_heap);
958962
FREE_PATHW()
959963
return -1;
960964
}
965+
#endif
961966

962967
substitutename_len = pbuffer->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR);
963968
if (substitutename_len > MAXPATHLEN) {
@@ -972,21 +977,25 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
972977
if (!substitutename) {
973978
free_alloca(pbuffer, use_heap_large);
974979
free_alloca(tmp, use_heap);
980+
#if VIRTUAL_CWD_DEBUG
975981
free(printname);
982+
#endif
976983
FREE_PATHW()
977984
return -1;
978985
}
979986
}
980987
else if(pbuffer->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) {
981988
isabsolute = 1;
982989
reparsetarget = pbuffer->MountPointReparseBuffer.ReparseTarget;
990+
#if VIRTUAL_CWD_DEBUG
983991
printname = php_win32_ioutil_w_to_any(reparsetarget + pbuffer->MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR));
984992
if (!printname) {
985993
free_alloca(pbuffer, use_heap_large);
986994
free_alloca(tmp, use_heap);
987995
FREE_PATHW()
988996
return -1;
989997
}
998+
#endif
990999

9911000

9921001
substitutename_len = pbuffer->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR);
@@ -1002,7 +1011,9 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
10021011
if (!substitutename) {
10031012
free_alloca(pbuffer, use_heap_large);
10041013
free_alloca(tmp, use_heap);
1014+
#if VIRTUAL_CWD_DEBUG
10051015
free(printname);
1016+
#endif
10061017
FREE_PATHW()
10071018
return -1;
10081019
}
@@ -1065,9 +1076,9 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
10651076
fprintf(stderr, "reparse: print: %s ", printname);
10661077
fprintf(stderr, "sub: %s ", substitutename);
10671078
fprintf(stderr, "resolved: %s ", path);
1079+
free(printname);
10681080
#endif
10691081
free_alloca(pbuffer, use_heap_large);
1070-
free(printname);
10711082
free(substitutename);
10721083

10731084
if(isabsolute == 1) {

0 commit comments

Comments
 (0)