2009-05-18 Paul Pluzhnikov <ppluzhnikov@google.com>
authorPaul Pluzhnikov <ppluzhnikov@google.com>
Mon, 18 May 2009 22:57:11 +0000 (22:57 +0000)
committerPaul Pluzhnikov <ppluzhnikov@google.com>
Mon, 18 May 2009 22:57:11 +0000 (22:57 +0000)
* objc-lang.c (find_methods): Plug a small memory leak.

gdb/ChangeLog
gdb/objc-lang.c

index dc775d1b776d70485726fafe55ec0728db6b05d6..b75d908075235a16463b047875742e73b0c92ee8 100644 (file)
@@ -1,3 +1,7 @@
+2009-05-18  Paul Pluzhnikov  <ppluzhnikov@google.com>
+
+       * objc-lang.c (find_methods): Plug a small memory leak.
+
 2009-05-18  Pedro Alves  <pedro@codesourcery.com>
 
        * solib-svr4.c: Include observer.h.
index aa55baf50bad14c45695237f52b68bfaf7135dc4..f1f33efe1ab4bdf27c1308fbab1f4e4445c46fa3 100644 (file)
@@ -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);
        }