Commit 922f8c84 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Check asprintf return

parent 41ce1a5d
...@@ -953,10 +953,12 @@ char *RealPath( const char *psz_src ) ...@@ -953,10 +953,12 @@ char *RealPath( const char *psz_src )
if( psz_dir[0] == '~' ) if( psz_dir[0] == '~' )
{ {
char *home = config_GetUserDir( VLC_HOME_DIR ), *dir; char *home = config_GetUserDir( VLC_HOME_DIR ), *dir;
asprintf( &dir, "%s%s", home, psz_dir + 1 ); if( asprintf( &dir, "%s%s", home, psz_dir + 1 ) != -1 )
free( psz_dir ); {
free( psz_dir );
psz_dir = dir;
}
free( home ); free( home );
psz_dir = dir;
} }
if( strlen(psz_dir) > 2 ) if( strlen(psz_dir) > 2 )
......
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