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] |
On Mon, May 18, 2009 at 2:27 PM, Tom Tromey <tromey@redhat.com> wrote: > Paul> + { > Paul> + ? objc_csym = xmalloc (sizeof (*objc_csym)); > Paul> + ? *objc_csym = objfile_csym; > Paul> + ? set_objfile_data (objfile, objc_objfile_data, objc_csym); > Paul> + } > > [...] > > Paul> +void > Paul> +_initialize_objc_lang (void) > Paul> +{ > Paul> + ?objc_objfile_data = register_objfile_data (); > Paul> +} > > I think this should probably call register_objfile_data_with_cleanup, > so that the per-objfile data can be freed when the objfile is > destroyed. I believe you are correct; I misread the objfile_free_data() code. But isn't a better fix to just obstack_alloc the data instead of xmalloc()ing it? Proposed patch attached. Tested on Linux/x86_64, no regressions. Thanks, -- Paul Pluzhnikov 2009-05-18 Paul Pluzhnikov <ppluzhnikov@google.com> * objc-lang.c (find_methods): Plug a small memory leak.
Attachment:
objc-memleak.txt
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |