Commit e0966aca authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Fix memleak

parent 0263f8f4
...@@ -455,11 +455,17 @@ int utf8_scandir( const char *dirname, char ***namelist, ...@@ -455,11 +455,17 @@ int utf8_scandir( const char *dirname, char ***namelist,
goto error; goto error;
if( !select( utf_entry ) ) if( !select( utf_entry ) )
{
free( utf_entry );
continue; continue;
}
newtab = realloc( tab, sizeof( char * ) * (num + 1) ); newtab = realloc( tab, sizeof( char * ) * (num + 1) );
if( newtab == NULL ) if( newtab == NULL )
{
free( utf_entry );
goto error; goto error;
}
tab = newtab; tab = newtab;
tab[num++] = utf_entry; tab[num++] = utf_entry;
} }
......
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