fix solib-som.c
authorTom Tromey <tromey@redhat.com>
Mon, 22 Jul 2013 18:00:50 +0000 (18:00 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 22 Jul 2013 18:00:50 +0000 (18:00 +0000)
som_open_symbol_file_object was leaking a cleanup.

* solib-som.c (som_open_symbol_file_object): Call do_cleanups.

gdb/ChangeLog
gdb/solib-som.c

index 66039099c620b4a0d79a6c7cca765d8e5dafd2ea..b0d3e5506b36acbc4df0100a415b01884386059d 100644 (file)
@@ -1,3 +1,7 @@
+2013-07-22  Tom Tromey  <tromey@redhat.com>
+
+       * solib-som.c (som_open_symbol_file_object): Call do_cleanups.
+
 2013-07-22  Tom Tromey  <tromey@redhat.com>
 
        * dwarf2read.c (init_cutu_and_read_dies): Remove 'free_cu_cleanup'.
index f88b53912593752f358913a7307b0696e1779e91..457e464d72cc8e8e73af8d39e1cffe491ee22b6b 100644 (file)
@@ -698,6 +698,7 @@ som_open_symbol_file_object (void *from_ttyp)
   int errcode;
   int from_tty = *(int *)from_ttyp;
   gdb_byte buf[4];
+  struct cleanup *cleanup;
 
   if (symfile_objfile)
     if (!query (_("Attempt to reload symbols from process? ")))
@@ -727,10 +728,11 @@ som_open_symbol_file_object (void *from_ttyp)
       return 0;
     }
 
-  make_cleanup (xfree, filename);
+  cleanup = make_cleanup (xfree, filename);
   /* Have a pathname: read the symbol file.  */
   symbol_file_add_main (filename, from_tty);
 
+  do_cleanups (cleanup);
   return 1;
 }