1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

wrc: Avoid undefined behavior in the FreeBSD case.

init_argv0_dir has a special case for FreeBSD where one branch led to
an unitialized variable and undefined behavior. Initialize properly.
This commit is contained in:
Gerald Pfeifer 2023-01-13 13:10:55 +01:00 committed by Alexandre Julliard
parent 696515d8d4
commit f221465a3c

View file

@ -305,6 +305,8 @@ static void init_argv0_dir( const char *argv0 )
char *path = xmalloc( path_size );
if (!sysctl( pathname, ARRAY_SIZE(pathname), path, &path_size, NULL, 0 ))
dir = realpath( path, NULL );
else
dir = NULL;
free( path );
#else
dir = realpath( argv0, NULL );