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

@ -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;
}