diff options
Diffstat (limited to 'src/lib/libkogata/mainloop.c')
-rw-r--r-- | src/lib/libkogata/mainloop.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/libkogata/mainloop.c b/src/lib/libkogata/mainloop.c index ece7672..58966dd 100644 --- a/src/lib/libkogata/mainloop.c +++ b/src/lib/libkogata/mainloop.c @@ -65,6 +65,8 @@ void mainloop_run() { for (mainloop_fd_t *fd = mainloop_fds; fd != 0; fd = fd->next) nfds++; + if (nfds == 0) return; + if (sel_arg != 0) free(sel_arg); sel_arg = (sel_fd_t*)malloc(nfds * sizeof(sel_fd_t)); if (sel_arg == 0) { |