aboutsummaryrefslogtreecommitdiff
path: root/src/lib/libkogata/mainloop.c
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2016-07-14 10:47:53 +0200
committerAlex Auvolat <alex@adnab.me>2016-07-14 10:47:53 +0200
commit477911553e0443fcafad5bd96c97314aa2f8d9ea (patch)
tree3825cba2552c0c4fe9cf64aecf065402db90f39e /src/lib/libkogata/mainloop.c
parentd09f8a08bdd9477bd463a2de03397ff56b5ce75d (diff)
downloadkogata-477911553e0443fcafad5bd96c97314aa2f8d9ea.tar.gz
kogata-477911553e0443fcafad5bd96c97314aa2f8d9ea.zip
Integration of scan-build and splint
Diffstat (limited to 'src/lib/libkogata/mainloop.c')
-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) {