File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed
src/rpc/webzockets/autobahn/client Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -402,13 +402,7 @@ const AutobahnClientHandler = struct {
402402 }
403403};
404404
405- // ============================================================================
406- // main
407- // ============================================================================
408-
409- pub fn main () ! void {
410- const allocator = std .heap .c_allocator ;
411-
405+ fn run (allocator : std.mem.Allocator ) ! void {
412406 // Wait for Docker fuzzingserver to start
413407 log .info ("Waiting for fuzzingserver on port 9001..." , .{});
414408 const max_retries = 60 ;
@@ -453,3 +447,19 @@ pub fn main() !void {
453447 log .info ("Autobahn client test run complete." , .{});
454448 log .info ("Check autobahn/client/reports/index.html for results." , .{});
455449}
450+
451+ pub fn main () ! void {
452+ var gpa = std .heap .GeneralPurposeAllocator (.{}){};
453+ const allocator = gpa .allocator ();
454+
455+ run (allocator ) catch | err | {
456+ if (gpa .deinit () == .leak ) {
457+ log .err ("GPA detected memory leaks while exiting with error: {}" , .{err });
458+ }
459+ return err ;
460+ };
461+
462+ if (gpa .deinit () == .leak ) {
463+ return error .MemoryLeakDetected ;
464+ }
465+ }
You can’t perform that action at this time.
0 commit comments