]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix minor leaks in dhat.
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Thu, 18 Apr 2019 18:39:52 +0000 (20:39 +0200)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Thu, 18 Apr 2019 18:41:44 +0000 (20:41 +0200)
Only leaks in dh_fini, and only once.
But fixing these leaks is easier than maintain suppression entries.

dhat/dh_main.c

index a93332884a653b75b5e79749f9316b4a1a172c3c..a0834a4cfd27ea3d7568f87fd3aa93e40490cc1e 100644 (file)
@@ -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);
 }
 
 //------------------------------------------------------------//