Skip to content

Commit

Permalink
Avoid crash by logging before free
Browse files Browse the repository at this point in the history
  • Loading branch information
aitorvs committed Jan 12, 2024
1 parent c7ffb84 commit e4ae2a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/netguard/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit e4ae2a6

Please sign in to comment.