rem: if ((locks = create_semaphores(PIKE_NR_LOCKS))==0) { LOG(L_ERR,"ERROR:pike_init: create sem failed!\n");
add: timer_lock=lock_alloc(); tree_lock=lock_alloc(); if ((timer_lock==0)||(tree_lock==0)) { LOG(L_ERR,"ERROR:pike_init: alloc locks failed!\n");
context: static int pike_init(void){	printf("pike - initializing\n");	/* init semaphore */	if ((locks = create_semaphores(PIKE_NR_LOCKS))==0) {		LOG(L_ERR,"ERROR:pike_init: create sem failed!\n");		goto error1;	}	/* init the IP tree */	tree = init_ip_tree(max_reqs);	if (!tree) {		LOG(L_ERR,"ERROR:pike_init: ip_tree creation failed!\n");		goto error2;	}	/* setting up timers */	timer = (struct pike_timer_head*)		shm_malloc(sizeof(struct pike_timer_head));	if (!timer) {		LOG(L_ERR,"ERROR:pike_init: no free shm mem\n");		goto error3;	}	memset(timer,0,sizeof(struct pike_timer_head));	timer->sem = &(locks[TIMER_LOCK]);	/* registering timeing functions  */	register_timer( clean_routine , 0, 1 );	register_timer( swap_routine , 0, time_unit );	return 0;error3:	destroy_ip_tree(tree);error2:	destroy_semaphores(locks);error1:	return -1;}