]> granicus.if.org Git - php/commitdiff
exclude debug code
authorAnatol Belski <ab@php.net>
Sat, 21 Jan 2017 01:17:06 +0000 (02:17 +0100)
committerAnatol Belski <ab@php.net>
Sat, 21 Jan 2017 01:17:06 +0000 (02:17 +0100)
Zend/zend_virtual_cwd.c

index b5e099848a36bf87a567259e1243b97aa53188aa..5a0b14901ad4a0f3502ce8f0d2e9644e2d87ceed 100644 (file)
@@ -913,7 +913,10 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
                        int bufindex = 0, isabsolute = 0;
                        wchar_t * reparsetarget;
                        BOOL isVolume = FALSE;
-                       char *printname = NULL, *substitutename = NULL;
+#if VIRTUAL_CWD_DEBUG
+                       char *printname = NULL;
+#endif
+                       char *substitutename = NULL;
                        size_t substitutename_len;
                        int substitutename_off = 0;
                        wchar_t tmpsubstname[MAXPATHLEN];
@@ -951,6 +954,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
                        if(pbuffer->ReparseTag == IO_REPARSE_TAG_SYMLINK) {
                                reparsetarget = pbuffer->SymbolicLinkReparseBuffer.ReparseTarget;
                                isabsolute = (pbuffer->SymbolicLinkReparseBuffer.Flags == 0) ? 1 : 0;
+#if VIRTUAL_CWD_DEBUG
                                printname = php_win32_ioutil_w_to_any(reparsetarget + pbuffer->MountPointReparseBuffer.PrintNameOffset  / sizeof(WCHAR));
                                if (!printname) {
                                        free_alloca(pbuffer, use_heap_large);
@@ -958,6 +962,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
                                        FREE_PATHW()
                                        return -1;
                                }
+#endif
 
                                substitutename_len = pbuffer->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR);
                                if (substitutename_len > MAXPATHLEN) {
@@ -972,7 +977,9 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
                                if (!substitutename) {
                                        free_alloca(pbuffer, use_heap_large);
                                        free_alloca(tmp, use_heap);
+#if VIRTUAL_CWD_DEBUG
                                        free(printname);
+#endif
                                        FREE_PATHW()
                                        return -1;
                                }
@@ -980,6 +987,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
                        else if(pbuffer->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) {
                                isabsolute = 1;
                                reparsetarget = pbuffer->MountPointReparseBuffer.ReparseTarget;
+#if VIRTUAL_CWD_DEBUG
                                printname = php_win32_ioutil_w_to_any(reparsetarget + pbuffer->MountPointReparseBuffer.PrintNameOffset  / sizeof(WCHAR));
                                if (!printname) {
                                        free_alloca(pbuffer, use_heap_large);
@@ -987,6 +995,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
                                        FREE_PATHW()
                                        return -1;
                                }
+#endif
 
 
                                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
                                if (!substitutename) {
                                        free_alloca(pbuffer, use_heap_large);
                                        free_alloca(tmp, use_heap);
+#if VIRTUAL_CWD_DEBUG
                                        free(printname);
+#endif
                                        FREE_PATHW()
                                        return -1;
                                }
@@ -1065,9 +1076,9 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
                        fprintf(stderr, "reparse: print: %s ", printname);
                        fprintf(stderr, "sub: %s ", substitutename);
                        fprintf(stderr, "resolved: %s ", path);
+                       free(printname);
 #endif
                        free_alloca(pbuffer, use_heap_large);
-                       free(printname);
                        free(substitutename);
 
                        if(isabsolute == 1) {