From b4403d38c7242a26c50addfc7880f94b153ea7b9 Mon Sep 17 00:00:00 2001 From: Philippe Waroquiers Date: Thu, 18 Apr 2019 20:39:52 +0200 Subject: [PATCH] Fix minor leaks in dhat. Only leaks in dh_fini, and only once. But fixing these leaks is easier than maintain suppression entries. --- dhat/dh_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dhat/dh_main.c b/dhat/dh_main.c index a93332884a..a0834a4cfd 100644 --- a/dhat/dh_main.c +++ b/dhat/dh_main.c @@ -1378,6 +1378,7 @@ static void dh_fini(Int exit_status) VKI_S_IRUSR|VKI_S_IWUSR); if (!fp) { VG_(umsg)("error: can't open DHAT output file '%s'\n", dhat_out_file); + VG_(free)(dhat_out_file); return; } @@ -1423,6 +1424,7 @@ static void dh_fini(Int exit_status) FP(" %c\"%s\"\n", i == 0 ? '[' : ',', json_escape(frames[i])); } FP(" ]\n"); + VG_(free)(frames); FP("}\n"); @@ -1452,6 +1454,8 @@ static void dh_fini(Int exit_status) VG_(umsg)(" %s\n", dhat_out_file); VG_(umsg)("Scroll to the end the displayed page to see a short\n"); VG_(umsg)("explanation of some of the abbreviations used in the page.\n"); + + VG_(free)(dhat_out_file); } //------------------------------------------------------------// -- 2.47.2