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] source.c:find_and_open_source cleanup


On Mon, Apr 07, 2008 at 12:34:12PM -0700, Doug Evans wrote:
> This is odd:
> 
>   if (result >= 0)
>     {
>       char *tmp_fullname;
>       tmp_fullname = *fullname;
>       *fullname = xstrdup (tmp_fullname);
>       xfree (tmp_fullname);
>     }
> 
> Is there something subtle going on here?
> I thought maybe the caller might be expecting a newly allocated value
> if it passed in a value for `fullname', but the previous value has
> already been freed at this point.
> 
> 2008-04-07  Doug Evans  <dje@google.com>
> 
> 	* source.c (find_and_open_source): Add some comments clarifying
> 	handling of FULLNAME argument.	Make static.  Remove pointless
> 	xstrdup/xfree.

Looks good to me.  Please commit, thanks!

-- 
Daniel Jacobowitz
CodeSourcery


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