aboutsummaryrefslogtreecommitdiff
path: root/src/lib/libkogata
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libkogata')
-rw-r--r--src/lib/libkogata/mainloop.c2
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) {