mirror of
https://github.com/wangyu-/udp2raw.git
synced 2025-01-19 06:19:31 +08:00
fix stack-use-after-scope reported by sanitizer
This commit is contained in:
parent
e66eddd1d5
commit
87b878a09e
8
main.cpp
8
main.cpp
@ -40,19 +40,19 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
pre_process_arg(argc, argv);
|
pre_process_arg(argc, argv);
|
||||||
|
|
||||||
|
ev_signal signal_watcher_sigpipe;
|
||||||
|
ev_signal signal_watcher_sigterm;
|
||||||
|
ev_signal signal_watcher_sigint;
|
||||||
|
|
||||||
if (program_mode == client_mode) {
|
if (program_mode == client_mode) {
|
||||||
struct ev_loop *loop = ev_default_loop(0);
|
struct ev_loop *loop = ev_default_loop(0);
|
||||||
#if !defined(__MINGW32__)
|
#if !defined(__MINGW32__)
|
||||||
ev_signal signal_watcher_sigpipe;
|
|
||||||
ev_signal_init(&signal_watcher_sigpipe, sigpipe_cb, SIGPIPE);
|
ev_signal_init(&signal_watcher_sigpipe, sigpipe_cb, SIGPIPE);
|
||||||
ev_signal_start(loop, &signal_watcher_sigpipe);
|
ev_signal_start(loop, &signal_watcher_sigpipe);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ev_signal signal_watcher_sigterm;
|
|
||||||
ev_signal_init(&signal_watcher_sigterm, sigterm_cb, SIGTERM);
|
ev_signal_init(&signal_watcher_sigterm, sigterm_cb, SIGTERM);
|
||||||
ev_signal_start(loop, &signal_watcher_sigterm);
|
ev_signal_start(loop, &signal_watcher_sigterm);
|
||||||
|
|
||||||
ev_signal signal_watcher_sigint;
|
|
||||||
ev_signal_init(&signal_watcher_sigint, sigint_cb, SIGINT);
|
ev_signal_init(&signal_watcher_sigint, sigint_cb, SIGINT);
|
||||||
ev_signal_start(loop, &signal_watcher_sigint);
|
ev_signal_start(loop, &signal_watcher_sigint);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user