From: Philippe Waroquiers Date: Thu, 18 Apr 2019 18:39:52 +0000 (+0200) Subject: Fix minor leaks in dhat. X-Git-Tag: VALGRIND_3_16_0~301 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4403d38c7242a26c50addfc7880f94b153ea7b9;p=thirdparty%2Fvalgrind.git Fix minor leaks in dhat. Only leaks in dh_fini, and only once. But fixing these leaks is easier than maintain suppression entries. --- 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); } //------------------------------------------------------------//