diff --git a/lib/service.c b/lib/service.c
index bbd0719d24b546a130c723d4275ee7788860ee6b..d27e4e0942b2a5cb6251801f5c5f547bf6769d3d 100644
--- a/lib/service.c
+++ b/lib/service.c
@@ -505,7 +505,7 @@ lws_service_fd_tsi(struct lws_context *context, struct lws_pollfd *pollfd, int t
 	char draining_flow = 0;
 	int timed_out = 0;
 	time_t now;
-	int n, m;
+	int n = 0, m;
 	int more;
 
 	/*