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: [RFC] stabsread, dbx_lookup_type, memory leak


> 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.



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