This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Fix readelf -sI (or -a)
- From: John Reiser <jreiser at BitWagon dot com>
- To: binutils at sources dot redhat dot com
- Date: Fri, 12 Jun 2009 05:50:48 -0700
- Subject: Re: [PATCH] Fix readelf -sI (or -a)
- References: <20090611192443.GI3101@sunsite.ms.mff.cuni.cz>
> --- binutils/readelf.c.jj 2009-05-28 19:35:03.000000000 +0200
> +++ binutils/readelf.c 2009-06-10 19:57:20.000000000 +0200
> @@ -7270,13 +7280,20 @@ process_symbol_table (FILE * file)
> + free (gnubuckets);
> + if (do_using_dynamic)
> + return 0;
> + gnubuckets = NULL;
It would be safer to set gnubuckets to NULL immediately after free()ing.
Allowing 'return' between "free (gnubuckets);" and "gnubuckets = NULL;"
allows bugs to propagate, and possibly making future maintenance more costly.
--