On Mon, May 18, 2009 at 2:27 PM, Tom Tromey 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 * objc-lang.c (find_methods): Plug a small memory leak.