Commit 94822425 authored by Alexandre Julliard's avatar Alexandre Julliard

Fixed memory allocation bug.

parent 99b68252
...@@ -722,6 +722,7 @@ static BOOL MODULE_CreateUnixProcess( LPCSTR filename, LPCSTR lpCmdLine, ...@@ -722,6 +722,7 @@ static BOOL MODULE_CreateUnixProcess( LPCSTR filename, LPCSTR lpCmdLine,
DOS_FULL_NAME full_name; DOS_FULL_NAME full_name;
const char *unixfilename = filename; const char *unixfilename = filename;
const char *argv[256], **argptr; const char *argv[256], **argptr;
char *p = NULL;
BOOL iconic = FALSE; BOOL iconic = FALSE;
/* Get Unix file name and iconic flag */ /* Get Unix file name and iconic flag */
...@@ -736,14 +737,12 @@ static BOOL MODULE_CreateUnixProcess( LPCSTR filename, LPCSTR lpCmdLine, ...@@ -736,14 +737,12 @@ static BOOL MODULE_CreateUnixProcess( LPCSTR filename, LPCSTR lpCmdLine,
argptr = argv; argptr = argv;
if ( !useWine ) if ( !useWine )
{ {
char *p = strdup(lpCmdLine); p = strdup(lpCmdLine);
if ( strchr(filename, '/') if (strchr(filename, '/') || strchr(filename, ':') || strchr(filename, '\\'))
|| strchr(filename, ':') {
|| strchr(filename, '\\') ) if ( DOSFS_GetFullName( filename, TRUE, &full_name ) )
{ unixfilename = full_name.long_name;
if ( DOSFS_GetFullName( filename, TRUE, &full_name ) ) }
unixfilename = full_name.long_name;
}
*argptr++ = unixfilename; *argptr++ = unixfilename;
if (iconic) *argptr++ = "-iconic"; if (iconic) *argptr++ = "-iconic";
while (1) while (1)
...@@ -753,7 +752,6 @@ static BOOL MODULE_CreateUnixProcess( LPCSTR filename, LPCSTR lpCmdLine, ...@@ -753,7 +752,6 @@ static BOOL MODULE_CreateUnixProcess( LPCSTR filename, LPCSTR lpCmdLine,
*argptr++ = p; *argptr++ = p;
while (*p && *p != ' ' && *p != '\t') p++; while (*p && *p != ' ' && *p != '\t') p++;
} }
free (p);
} }
else else
{ {
...@@ -784,6 +782,7 @@ static BOOL MODULE_CreateUnixProcess( LPCSTR filename, LPCSTR lpCmdLine, ...@@ -784,6 +782,7 @@ static BOOL MODULE_CreateUnixProcess( LPCSTR filename, LPCSTR lpCmdLine,
memset( lpProcessInfo, '\0', sizeof( *lpProcessInfo ) ); memset( lpProcessInfo, '\0', sizeof( *lpProcessInfo ) );
lpProcessInfo->hProcess = INVALID_HANDLE_VALUE; lpProcessInfo->hProcess = INVALID_HANDLE_VALUE;
lpProcessInfo->hThread = INVALID_HANDLE_VALUE; lpProcessInfo->hThread = INVALID_HANDLE_VALUE;
if (p) free(p);
SetLastError( ERROR_SUCCESS ); SetLastError( ERROR_SUCCESS );
return TRUE; return TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment