btrace: Fix memory leak in btrace_clear.
authorTim Wiederhake <tim.wiederhake@intel.com>
Fri, 5 May 2017 06:20:50 +0000 (08:20 +0200)
committerTim Wiederhake <tim.wiederhake@intel.com>
Fri, 5 May 2017 06:20:50 +0000 (08:20 +0200)
gdb/ChangeLog
gdb/btrace.c

index 475091d7805e1c4b147c0b6b73dd7f627ddc93d7..5faefca1d8895d3213e03cc31d62908642019d2d 100644 (file)
@@ -1,3 +1,7 @@
+2017-05-05  Tim Wiederhake  <tim.wiederhake@intel.com>
+
+       * btrace.c (btrace_clear): Free insn vector.
+
 2017-05-05  Pedro Alves  <palves@redhat.com>
 
        * warning.m4 (build_warnings): Add -Wno-error=maybe-uninitialized.
index 380108682ef208b2da6e678f1af2922822c95dfd..20c977a2815152a43b98a62550d780fa05fbdb75 100644 (file)
@@ -1893,6 +1893,7 @@ btrace_clear (struct thread_info *tp)
       trash = it;
       it = it->flow.next;
 
+      VEC_free (btrace_insn_s, trash->insn);
       xfree (trash);
     }