]> sourceware.org Git - systemtap.git/commitdiff
task_finder: call _stp_vma_done() upon error to fix memory leak
authorSultan Alsawaf <sultan@openresty.com>
Tue, 17 Nov 2020 19:03:53 +0000 (11:03 -0800)
committerSultan Alsawaf <sultan@openresty.com>
Tue, 17 Nov 2020 19:24:13 +0000 (11:24 -0800)
The memory allocated inside stap_initialize_vma_map() is not freed upon
error when the task finder is started because a call to _stp_vma_done()
in the error path is missing. Add it to fix the leak.

task_finder.cxx

index d08d44a752b1d5fc3fb37fcb78280544649ff67a..7c45e728bf7f97dddc4945a7e25e7d036fcdfcd7 100644 (file)
@@ -66,6 +66,7 @@ task_finder_derived_probe_group::emit_module_init (systemtap_session& s)
 
   s.op->newline() << "if (rc) {";
   s.op->newline(1) << "stap_stop_task_finder();";
+  s.op->newline() << "_stp_vma_done();";
   s.op->newline(-1) << "}";
   s.op->newline(-1) << "}";
 }
This page took 0.026726 seconds and 5 git commands to generate.