1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Asan: Fix global ip address leak check bug. v5.0.90 (#3248)

* asan: fix global ips memory leak bug

* Asan: Fix global ip address leak check. v5.0.90

* Asan: Directly start SRS for daemon error fixed.

Co-authored-by: winlin <winlin@vip.126.com>
This commit is contained in:
ChenGH 2022-11-21 20:22:13 +08:00 committed by GitHub
parent 9191217e27
commit f4f9c70d79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 21 additions and 15 deletions

View file

@ -74,6 +74,9 @@ bool _srs_config_by_env = false;
// The binary name of SRS.
const char* _srs_binary = NULL;
// Free global data, for address sanitizer.
extern void srs_free_global_system_ips();
/**
* main entrance.
*/
@ -222,7 +225,9 @@ srs_error_t do_main(int argc, char** argv, char** envp)
if ((err = run_directly_or_daemon()) != srs_success) {
return srs_error_wrap(err, "run");
}
srs_free_global_system_ips();
return err;
}
@ -447,6 +452,7 @@ srs_error_t run_directly_or_daemon()
int status = 0;
waitpid(pid, &status, 0);
srs_trace("grandpa process exit.");
srs_free_global_system_ips();
exit(0);
}
@ -459,6 +465,7 @@ srs_error_t run_directly_or_daemon()
if(pid > 0) {
srs_trace("father process exit");
srs_free_global_system_ips();
exit(0);
}