Fix memory leak in watch_main_source_file_lossage.
authorDoug Evans <xdje42@gmail.com>
Tue, 18 Nov 2014 17:00:15 +0000 (09:00 -0800)
committerDoug Evans <xdje42@gmail.com>
Tue, 18 Nov 2014 17:00:15 +0000 (09:00 -0800)
gdb/ChangeLog:

* buildsym.c (watch_main_source_file_lossage): Fix memory leak.

gdb/ChangeLog
gdb/buildsym.c

index c17d517..fd5fd69 100644 (file)
@@ -1,5 +1,9 @@
 2014-11-18  Doug Evans  <xdje42@gmail.com>
 
+       * buildsym.c (watch_main_source_file_lossage): Fix memory leak.
+
+2014-11-18  Doug Evans  <xdje42@gmail.com>
+
        * cp-namespace.c (cp_lookup_symbol_imports_or_template): Use
        SYMBOL_OBJFILE.
        * findvar.c (default_read_var_value): Ditto.
index 3d92a85..3ea8ff0 100644 (file)
@@ -989,6 +989,8 @@ watch_main_source_file_lossage (void)
            subfiles = mainsub_alias->next;
          else
            prev_mainsub_alias->next = mainsub_alias->next;
+         xfree (mainsub_alias->name);
+         xfree (mainsub_alias->dirname);
          xfree (mainsub_alias);
        }
     }