readelf: zero static vars after freeing

When readelf is processing more than one file, static bss vars won't
start out as zero for the second file unless they are cleared.

	* readelf.c (process_symbol_table): Zero gnubuckets, gnuchains
	etc. after freeing.
This commit is contained in:
Alan Modra 2020-04-15 16:40:54 +09:30
parent 89246a0e79
commit b71d4fa7c3
2 changed files with 13 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2020-04-15 Alan Modra <amodra@gmail.com>
* readelf.c (process_symbol_table): Zero gnubuckets, gnuchains
etc. after freeing.
2020-04-15 Alan Modra <amodra@gmail.com>
* readelf.c (get_group_flags): Translate text.

View File

@ -12260,16 +12260,24 @@ process_symbol_table (Filedata * filedata)
free (lengths);
}
free (gnubuckets);
gnubuckets = NULL;
free (gnuchains);
gnuchains = NULL;
free (mipsxlat);
mipsxlat = NULL;
return TRUE;
err_out:
free (gnubuckets);
gnubuckets = NULL;
free (gnuchains);
gnuchains = NULL;
free (mipsxlat);
mipsxlat = NULL;
free (buckets);
buckets = NULL;
free (chains);
chains = NULL;
return FALSE;
}