From 6342b74acd00f16f0a0b60a04469a400cb86e884 Mon Sep 17 00:00:00 2001 From: Paul Pluzhnikov Date: Mon, 18 May 2009 22:57:11 +0000 Subject: [PATCH] 2009-05-18 Paul Pluzhnikov * objc-lang.c (find_methods): Plug a small memory leak. --- gdb/ChangeLog | 4 ++++ gdb/objc-lang.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index dc775d1b776..b75d9080752 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2009-05-18 Paul Pluzhnikov + + * objc-lang.c (find_methods): Plug a small memory leak. + 2009-05-18 Pedro Alves * solib-svr4.c: Include observer.h. diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index aa55baf50ba..f1f33efe1ab 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -1259,7 +1259,8 @@ find_methods (struct symtab *symtab, char type, } if (objc_csym == NULL) { - objc_csym = xmalloc (sizeof (*objc_csym)); + objc_csym = obstack_alloc (&objfile->objfile_obstack, + sizeof (*objc_csym)); *objc_csym = objfile_csym; set_objfile_data (objfile, objc_objfile_data, objc_csym); } -- 2.30.2