@@ -281,12 +281,14 @@ static int sb_append_chunk_to_segregated_backlogs(struct cio_chunk *target_chun
281281 int tag_len ;
282282 const char * tag_buf ;
283283 int result ;
284+ size_t slots ;
284285
285286 memset (& dummy_input_chunk , 0 , sizeof (struct flb_input_chunk ));
286287
288+ slots = flb_routes_mask_get_slots (context -> ins -> config -> router );
287289 memset (context -> dummy_routes_mask ,
288290 0 ,
289- context -> ins -> config -> route_mask_slots * sizeof (flb_route_mask_element ));
291+ slots * sizeof (flb_route_mask_element ));
290292
291293 dummy_input_chunk .in = context -> ins ;
292294 dummy_input_chunk .chunk = target_chunk ;
@@ -317,7 +319,7 @@ static int sb_append_chunk_to_segregated_backlogs(struct cio_chunk *target_chun
317319 backlog = mk_list_entry (head , struct sb_out_queue , _head );
318320 if (flb_routes_mask_get_bit (dummy_input_chunk .routes_mask ,
319321 backlog -> ins -> id ,
320- backlog -> ins -> config )) {
322+ backlog -> ins -> config -> router )) {
321323 result = sb_append_chunk_to_segregated_backlog (target_chunk , stream ,
322324 chunk_size , backlog );
323325 if (result ) {
@@ -656,6 +658,7 @@ static int cb_sb_init(struct flb_input_instance *in,
656658 int ret ;
657659 char mem [32 ];
658660 struct flb_sb * ctx ;
661+ size_t slots ;
659662
660663 ctx = flb_calloc (1 , sizeof (struct flb_sb ));
661664
@@ -664,7 +667,8 @@ static int cb_sb_init(struct flb_input_instance *in,
664667 return -1 ;
665668 }
666669
667- ctx -> dummy_routes_mask = flb_calloc (in -> config -> route_mask_slots ,
670+ slots = flb_routes_mask_get_slots (config -> router );
671+ ctx -> dummy_routes_mask = flb_calloc (slots ,
668672 sizeof (flb_route_mask_element ));
669673
670674 if (ctx -> dummy_routes_mask == NULL ) {
0 commit comments