Commit 4f778db5 authored by Gildas Bazin's avatar Gildas Bazin

* src/input/es_out.c: fixed another small mem leak.

parent 6e4e6ab1
...@@ -1292,8 +1292,7 @@ static char **LanguageSplit( const char *psz_langs ) ...@@ -1292,8 +1292,7 @@ static char **LanguageSplit( const char *psz_langs )
char **ppsz = NULL; char **ppsz = NULL;
int i_psz = 0; int i_psz = 0;
if( psz_langs == NULL ) if( psz_langs == NULL ) return NULL;
return NULL;
psz_parser = psz_dup = strdup(psz_langs); psz_parser = psz_dup = strdup(psz_langs);
...@@ -1303,10 +1302,7 @@ static char **LanguageSplit( const char *psz_langs ) ...@@ -1303,10 +1302,7 @@ static char **LanguageSplit( const char *psz_langs )
char *psz_code; char *psz_code;
psz = strchr(psz_parser, ',' ); psz = strchr(psz_parser, ',' );
if( psz ) if( psz ) *psz++ = '\0';
{
*psz++ = '\0';
}
psz_code = LanguageGetCode( psz_parser ); psz_code = LanguageGetCode( psz_parser );
if( strcmp( psz_code, "??" ) ) if( strcmp( psz_code, "??" ) )
...@@ -1322,6 +1318,7 @@ static char **LanguageSplit( const char *psz_langs ) ...@@ -1322,6 +1318,7 @@ static char **LanguageSplit( const char *psz_langs )
TAB_APPEND( i_psz, ppsz, NULL ); TAB_APPEND( i_psz, ppsz, NULL );
} }
free( psz_dup );
return ppsz; return ppsz;
} }
...@@ -1329,12 +1326,10 @@ static int LanguageArrayIndex( char **ppsz_langs, char *psz_lang ) ...@@ -1329,12 +1326,10 @@ static int LanguageArrayIndex( char **ppsz_langs, char *psz_lang )
{ {
int i; int i;
if( !ppsz_langs || !psz_lang ) if( !ppsz_langs || !psz_lang ) return -1;
return -1;
for( i = 0; ppsz_langs[i]; i++ ) for( i = 0; ppsz_langs[i]; i++ )
if( !strcasecmp( ppsz_langs[i], psz_lang ) ) if( !strcasecmp( ppsz_langs[i], psz_lang ) ) return i;
return i;
return -1; return -1;
} }
......
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