From c2f20b16030f9099bc04da26154709c25ba5f6f0 Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Sat, 2 Mar 2013 11:14:17 +0000 Subject: Fix: When adding a pid to probes list, the daemon would fill all slots and quickly run out of memory --- jaildaemon.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jaildaemon.c b/jaildaemon.c index 7dad058..1c6a86f 100644 --- a/jaildaemon.c +++ b/jaildaemon.c @@ -316,8 +316,10 @@ static int add_task_to_kqueue( int kq, daemon_task * t_in ) { /* Account for new pid */ for( i = 0; i < g_probes_size; ++i ) - if( !g_probes[i] ) + if( !g_probes[i] ) { g_probes[i] = pid; + break; + } /* No space for pid entry => make room */ if( i == g_probes_size ) { -- cgit v1.2.3