Fix memory leak using libevent (#1751)

Fixes #1750
This commit is contained in:
Pavel Punsky 2025-09-28 21:00:44 -07:00 committed by GitHub
parent b1dddb5f49
commit 63447a763a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1416,10 +1416,10 @@ const char *turn_get_ssl_method(SSL *ssl, const char *mdefault) {
struct event_base *turn_event_base_new(void) {
struct event_config *cfg = event_config_new();
event_config_set_flag(cfg, EVENT_BASE_FLAG_EPOLL_USE_CHANGELIST);
return event_base_new_with_config(cfg);
struct event_base *base = event_base_new_with_config(cfg);
event_config_free(cfg); // Free the config after use to make valgrind happy
return base;
}
/////////// OAUTH /////////////////