mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-02 12:03:45 +00:00
Fixed memory allocation bug.
This commit is contained in:
parent
99b68252a1
commit
94822425f0
1 changed files with 8 additions and 9 deletions
|
@ -722,6 +722,7 @@ static BOOL MODULE_CreateUnixProcess( LPCSTR filename, LPCSTR lpCmdLine,
|
|||
DOS_FULL_NAME full_name;
|
||||
const char *unixfilename = filename;
|
||||
const char *argv[256], **argptr;
|
||||
char *p = NULL;
|
||||
BOOL iconic = FALSE;
|
||||
|
||||
/* Get Unix file name and iconic flag */
|
||||
|
@ -736,10 +737,8 @@ static BOOL MODULE_CreateUnixProcess( LPCSTR filename, LPCSTR lpCmdLine,
|
|||
argptr = argv;
|
||||
if ( !useWine )
|
||||
{
|
||||
char *p = strdup(lpCmdLine);
|
||||
if ( strchr(filename, '/')
|
||||
|| strchr(filename, ':')
|
||||
|| strchr(filename, '\\') )
|
||||
p = strdup(lpCmdLine);
|
||||
if (strchr(filename, '/') || strchr(filename, ':') || strchr(filename, '\\'))
|
||||
{
|
||||
if ( DOSFS_GetFullName( filename, TRUE, &full_name ) )
|
||||
unixfilename = full_name.long_name;
|
||||
|
@ -753,7 +752,6 @@ static BOOL MODULE_CreateUnixProcess( LPCSTR filename, LPCSTR lpCmdLine,
|
|||
*argptr++ = p;
|
||||
while (*p && *p != ' ' && *p != '\t') p++;
|
||||
}
|
||||
free (p);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -784,6 +782,7 @@ static BOOL MODULE_CreateUnixProcess( LPCSTR filename, LPCSTR lpCmdLine,
|
|||
memset( lpProcessInfo, '\0', sizeof( *lpProcessInfo ) );
|
||||
lpProcessInfo->hProcess = INVALID_HANDLE_VALUE;
|
||||
lpProcessInfo->hThread = INVALID_HANDLE_VALUE;
|
||||
if (p) free(p);
|
||||
|
||||
SetLastError( ERROR_SUCCESS );
|
||||
return TRUE;
|
||||
|
|
Loading…
Reference in a new issue