Commit 10fcb9f9 authored by Rémi Duraffort's avatar Rémi Duraffort

Access dvdread: use setenv instead of putenv to fix a memleak.

parent 6b908430
...@@ -222,25 +222,10 @@ static int Open( vlc_object_t *p_this ) ...@@ -222,25 +222,10 @@ static int Open( vlc_object_t *p_this )
psz_name[2] == '\\' && psz_name[3] == '\0' ) psz_name[2] = '\0'; psz_name[2] == '\\' && psz_name[3] == '\0' ) psz_name[2] = '\0';
#endif #endif
/* Override environment variable DVDCSS_METHOD with config option /* Override environment variable DVDCSS_METHOD with config option */
* (FIXME: this creates a small memory leak) */
psz_dvdcss_env = config_GetPsz( p_demux, "dvdread-css-method" ); psz_dvdcss_env = config_GetPsz( p_demux, "dvdread-css-method" );
if( psz_dvdcss_env && *psz_dvdcss_env ) if( psz_dvdcss_env && *psz_dvdcss_env )
{ setenv( "DVDCSS_METHOD", psz_dvdcss_env, 1 );
char *psz_env;
psz_env = malloc( strlen("DVDCSS_METHOD=") +
strlen( psz_dvdcss_env ) + 1 );
if( !psz_env )
{
free( psz_dvdcss_env );
return VLC_ENOMEM;
}
sprintf( psz_env, "%s%s", "DVDCSS_METHOD=", psz_dvdcss_env );
putenv( psz_env );
}
free( psz_dvdcss_env ); free( psz_dvdcss_env );
/* Open dvdread */ /* Open dvdread */
......
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