This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] fix thinko in sym info


This should be:

> +ÂÂÂÂÂÂÂif (offset)
> +ÂÂÂÂÂÂÂ Âxasprintf (&loc_string, "%s + %u", msym_name, offset);
> +ÂÂÂÂÂÂÂelse
> +ÂÂÂÂÂÂÂ Âxasprintf (&loc_string, "%s", msym_name);
> +

        ... = make_cleanup (xfree, loc_string);


> +ÂÂÂÂÂÂÂfree (loc_string);

        do_cleanups (...);

> Â Â Â Â}

... instead of raw 'free'.

The easiest exception you can get here, is if the user quits on a
pagination request inside print_filtered.

There, see, a huge leak is plugged fixed.  :-)

(would be s/free/xfree/, btw.)

Other than that, it also looks good to me.

I'd say, go ahead!

-- 
Pedro Alves

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]