mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 18:54:41 +00:00
wmc: Avoid uninitialized variable in init_argv0_dir.
init_argv0_dir has conditional code for different operating systems. In case of FreeBSD a variable remains uninitialized in the error case, yet is then used. Fix that by handling the error case.
This commit is contained in:
parent
9761191f1c
commit
4bbdbc759a
|
@ -160,6 +160,8 @@ static void init_argv0_dir( const char *argv0 )
|
||||||
char *path = xmalloc( path_size );
|
char *path = xmalloc( path_size );
|
||||||
if (!sysctl( pathname, ARRAY_SIZE(pathname), path, &path_size, NULL, 0 ))
|
if (!sysctl( pathname, ARRAY_SIZE(pathname), path, &path_size, NULL, 0 ))
|
||||||
dir = realpath( path, NULL );
|
dir = realpath( path, NULL );
|
||||||
|
else
|
||||||
|
dir = NULL;
|
||||||
free( path );
|
free( path );
|
||||||
#else
|
#else
|
||||||
dir = realpath( argv0, NULL );
|
dir = realpath( argv0, NULL );
|
||||||
|
|
Loading…
Reference in a new issue