diff --git a/trunk/src/main/srs_main_server.cpp b/trunk/src/main/srs_main_server.cpp index 01e9b249f5..33aa7375f6 100644 --- a/trunk/src/main/srs_main_server.cpp +++ b/trunk/src/main/srs_main_server.cpp @@ -81,9 +81,6 @@ const char* _srs_binary = NULL; // @global Other variables. bool _srs_in_docker = false; -// Free global data, for address sanitizer. -extern void srs_free_global_system_ips(); - #ifdef SRS_SANITIZER_LOG extern void asan_report_callback(const char* str); #endif @@ -242,9 +239,7 @@ srs_error_t do_main(int argc, char** argv, char** envp) __asan_set_error_report_callback(asan_report_callback); #endif - err = run_directly_or_daemon(); - srs_free_global_system_ips(); - if (err != srs_success) { + if ((err = run_directly_or_daemon()) != srs_success) { return srs_error_wrap(err, "run"); } @@ -440,7 +435,6 @@ 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); } @@ -453,7 +447,6 @@ srs_error_t run_directly_or_daemon() if(pid > 0) { srs_trace("father process exit"); - srs_free_global_system_ips(); exit(0); } diff --git a/trunk/src/protocol/srs_protocol_utility.cpp b/trunk/src/protocol/srs_protocol_utility.cpp index 749ea3342f..620ebfea45 100644 --- a/trunk/src/protocol/srs_protocol_utility.cpp +++ b/trunk/src/protocol/srs_protocol_utility.cpp @@ -673,17 +673,6 @@ bool srs_net_device_is_internet(const sockaddr* addr) } vector _srs_system_ips; -void srs_free_global_system_ips() -{ - vector& ips = _srs_system_ips; - - // Release previous IPs. - for (int i = 0; i < (int)ips.size(); i++) { - SrsIPAddress* ip = ips[i]; - srs_freep(ip); - } - ips.clear(); -} void discover_network_iface(ifaddrs* cur, vector& ips, stringstream& ss0, stringstream& ss1, bool ipv6, bool loopback) { @@ -721,9 +710,6 @@ void discover_network_iface(ifaddrs* cur, vector& ips, stringstre void retrieve_local_ips() { - // Release previous IPs. - srs_free_global_system_ips(); - vector& ips = _srs_system_ips; // Get the addresses. diff --git a/trunk/src/utest/srs_utest.cpp b/trunk/src/utest/srs_utest.cpp index 9a9dca5dcb..866ef1fc11 100644 --- a/trunk/src/utest/srs_utest.cpp +++ b/trunk/src/utest/srs_utest.cpp @@ -96,9 +96,6 @@ srs_error_t prepare_main() { return err; } -// Free global data, for address sanitizer. -extern void srs_free_global_system_ips(); - // We could do something in the main of utest. // Copy from gtest-1.6.0/src/gtest_main.cc GTEST_API_ int main(int argc, char **argv) { @@ -117,8 +114,6 @@ GTEST_API_ int main(int argc, char **argv) { testing::InitGoogleTest(&argc, argv); int r0 = RUN_ALL_TESTS(); - srs_free_global_system_ips(); - return r0; }