Explorar o código

pike: check that timer var is initialized before accessing the fields

- safe start with empty config, reported by Olle E. Johansson, GH#39
Daniel-Constantin Mierla %!s(int64=10) %!d(string=hai) anos
pai
achega
c87a75c5fb
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      modules/pike/pike_funcs.c

+ 1 - 1
modules/pike/pike_funcs.c

@@ -172,7 +172,7 @@ void clean_routine(unsigned int ticks , void *param)
 	/* LM_DBG("entering (%d)\n",ticks); */
 	/* before locking check first if the list is not empty and if can
 	 * be at least one element removed */
-	if ( is_list_empty( timer )) return; /* quick exit */
+	if (timer==0 || is_list_empty( timer )) return; /* quick exit */
 
 	/* get the expired elements */
 	lock_get( timer_lock );