@@ -492,6 +492,7 @@ int notify_ebr_subscriptions( ebr_event *ev, evi_params_t *params)
492
492
job = (ebr_ipc_job * )shm_malloc ( sizeof (ebr_ipc_job ) );
493
493
if (job == NULL ) {
494
494
LM_ERR ("failed to allocated new IPC job, skipping..\n" );
495
+ sub_next = sub -> next ;
495
496
continue ; /* with the next subscription */
496
497
}
497
498
job -> ev = ev ;
@@ -504,6 +505,7 @@ int notify_ebr_subscriptions( ebr_event *ev, evi_params_t *params)
504
505
if (ipc_send_job ( sub -> proc_no , ebr_ipc_type , (void * )job )< 0 ) {
505
506
LM_ERR ("failed to send job via IPC, skipping...\n" );
506
507
shm_free (job );
508
+ sub_next = sub -> next ;
507
509
continue ; /* keep it and try next time */
508
510
}
509
511
}
@@ -556,6 +558,7 @@ int notify_ebr_subscriptions( ebr_event *ev, evi_params_t *params)
556
558
job = (ebr_ipc_job * )shm_malloc ( sizeof (ebr_ipc_job ) );
557
559
if (job == NULL ) {
558
560
LM_ERR ("failed to allocated new IPC job, skipping..\n" );
561
+ sub_next = sub -> next ;
559
562
continue ; /* with the next subscription */
560
563
}
561
564
@@ -653,8 +656,10 @@ void ebr_timeout(unsigned int ticks, void* param)
653
656
sub = sub_next ?sub_next :(sub ?sub -> next :NULL ) ) {
654
657
655
658
/* skip valid and non WAIT subscriptions */
656
- if ( (sub -> flags & EBR_SUBS_TYPE_WAIT )== 0 || sub -> expire > my_time )
659
+ if ( (sub -> flags & EBR_SUBS_TYPE_WAIT )== 0 || sub -> expire > my_time ) {
660
+ sub_next = sub -> next ;
657
661
continue ;
662
+ }
658
663
659
664
LM_DBG ("subscription type [%s] from process %d(pid %d) on "
660
665
"event <%.*s> expired at %d, now %d\n" ,
@@ -667,6 +672,7 @@ void ebr_timeout(unsigned int ticks, void* param)
667
672
job = (ebr_ipc_job * )shm_malloc ( sizeof (ebr_ipc_job ) );
668
673
if (job == NULL ) {
669
674
LM_ERR ("failed to allocated new IPC job, skipping..\n" );
675
+ sub_next = sub -> next ;
670
676
continue ; /* with the next subscription */
671
677
}
672
678
job -> ev = ev ;
@@ -679,6 +685,7 @@ void ebr_timeout(unsigned int ticks, void* param)
679
685
if (ipc_send_job ( sub -> proc_no , ebr_ipc_type , (void * )job )< 0 ) {
680
686
LM_ERR ("failed to send job via IPC, skipping...\n" );
681
687
shm_free (job );
688
+ sub_next = sub -> next ;
682
689
continue ; /* with the next subscription */
683
690
}
684
691
0 commit comments