Skip to content

Commit

Permalink
asan: Fix memory leak in asan by releasing global IPs when run_direct…
Browse files Browse the repository at this point in the history
…ly_or_daemon fails. v5.0.154, v6.0.44 (ossrs#3541)

* asan: when run_directly_or_daemon failed, release gloabal ips

* asan: refine global system ips release code

* Update release to v5.0.154, v6.0.44

---------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
  • Loading branch information
2 people authored and johzzy committed Jun 25, 2023
1 parent 90192b5 commit 7cd2492
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion trunk/src/main/srs_main_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,13 @@ srs_error_t do_main(int argc, char** argv, char** envp)
}
#endif

if ((err = run_directly_or_daemon()) != srs_success) {
#ifdef SRS_SANITIZER_LOG
__asan_set_error_report_callback(asan_report_callback);
#endif

err = run_directly_or_daemon();
srs_free_global_system_ips();
if (err != srs_success) {
return srs_error_wrap(err, "run");
}

Expand Down

0 comments on commit 7cd2492

Please sign in to comment.