This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] stabsread, dbx_lookup_type, memory leak
- From: msnyder at sonic dot net
- To: msnyder at sonic dot net
- Cc: gdb-patches at sourceware dot org, jimb at codesourcery dot com
- Date: Fri, 17 Aug 2007 16:44:48 -0700 (PDT)
- Subject: Re: [RFC] stabsread, dbx_lookup_type, memory leak
- References: <24844.12.7.175.2.1186687714.squirrel@webmail.sonic.net>
> This one's non-trivial, and I'd like a 2nd or 3rd pair of eyes.
>
> Only in an error condition, dbx_lookup_type mallocs enough memory
> for a pointer (struct type **), and uses it to return an error type.
>
> Many callers dereference this pointer, but it seems as if nobody
> ever saves it.
>
> And of course, nobody ever frees it.
>
> Using a static is not reentrant, but since nobody ever saves it,
> someone would have to make repeated calls to dbx_lookup_type very
> close to each other, while juggling return values, in order to get
> into trouble.
>
> This has been in there since version 1.1.
OK, no opinions -- so committed.