From e4ae2a6d5dc7e6857ebcb7d9f8e4eab8f682bccf Mon Sep 17 00:00:00 2001 From: Aitor Viana Date: Wed, 3 Jan 2024 02:17:09 +0100 Subject: [PATCH] Avoid crash by logging before free --- src/netguard/session.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/netguard/session.c b/src/netguard/session.c index 7754c45..a9f21b0 100644 --- a/src/netguard/session.c +++ b/src/netguard/session.c @@ -292,10 +292,11 @@ void *handle_events(void *a) { log_print(PLATFORM_LOG_PRIORITY_ERROR, "epoll close error %d: %s", errno, strerror(errno)); + log_print(PLATFORM_LOG_PRIORITY_WARN, "Stopped events tun=%d", args->tun); + // Cleanup ng_free(args, __FILE__, __LINE__); - log_print(PLATFORM_LOG_PRIORITY_WARN, "Stopped events tun=%d", args->tun); return NULL; }