diff options
Diffstat (limited to 'bundles/org.eclipse.equinox.executable/library/eclipseCommon.c')
-rw-r--r-- | bundles/org.eclipse.equinox.executable/library/eclipseCommon.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.executable/library/eclipseCommon.c b/bundles/org.eclipse.equinox.executable/library/eclipseCommon.c index 01ed623f6..714eb824a 100644 --- a/bundles/org.eclipse.equinox.executable/library/eclipseCommon.c +++ b/bundles/org.eclipse.equinox.executable/library/eclipseCommon.c @@ -186,7 +186,12 @@ _TCHAR* findCommand( _TCHAR* command ) cmdPath = NULL; } - return resolveSymlinks(cmdPath); + ch = resolveSymlinks(cmdPath); + if (ch != cmdPath) { + free(cmdPath); + cmdPath = ch; + } + return cmdPath; } #if !defined(_WIN32) && !defined(MACOSX) @@ -198,7 +203,6 @@ char * resolveSymlinks( char * path ) { ch = path; buffer = malloc(PATH_MAX); path = realpath(path, buffer); - free(ch); return path; } #endif |