summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <>2013-03-02 11:14:17 +0000
committererdgeist <>2013-03-02 11:14:17 +0000
commitc2f20b16030f9099bc04da26154709c25ba5f6f0 (patch)
tree058e27e203971027bab699effa7bcfc49a8c371b
parente4f6f5b57ffa8fd93b41829b7130ad7f46af26ba (diff)
Fix: When adding a pid to probes list, the daemon would fill all slots and quickly run out of memory
-rw-r--r--jaildaemon.c4
1 files changed, 3 insertions, 1 deletions
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 ) {
316 316
317 /* Account for new pid */ 317 /* Account for new pid */
318 for( i = 0; i < g_probes_size; ++i ) 318 for( i = 0; i < g_probes_size; ++i )
319 if( !g_probes[i] ) 319 if( !g_probes[i] ) {
320 g_probes[i] = pid; 320 g_probes[i] = pid;
321 break;
322 }
321 323
322 /* No space for pid entry => make room */ 324 /* No space for pid entry => make room */
323 if( i == g_probes_size ) { 325 if( i == g_probes_size ) {