From 63447a763a689493bccf44afd6e70b418503a47b Mon Sep 17 00:00:00 2001 From: Pavel Punsky Date: Sun, 28 Sep 2025 21:00:44 -0700 Subject: [PATCH] Fix memory leak using libevent (#1751) Fixes #1750 --- src/apps/common/apputils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/apps/common/apputils.c b/src/apps/common/apputils.c index 786781b..61a78a6 100644 --- a/src/apps/common/apputils.c +++ b/src/apps/common/apputils.c @@ -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 /////////////////