Skip to content

Commit 39fa81b

Browse files
committed
input_chunk: check return values when calculating found chunks for new space.
Signed-off-by: Phillip Adair Stewart Whelan <[email protected]>
1 parent 09d9e8a commit 39fa81b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/flb_input_chunk.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ int flb_input_chunk_find_space_new_data(struct flb_input_chunk *ic,
530530
"new data coming from input plugin %s", flb_input_name(ic->in));
531531
}
532532

533-
return 0;
533+
return count;
534534
}
535535

536536
/*
@@ -575,13 +575,18 @@ int flb_input_chunk_has_overlimit_routes(struct flb_input_chunk *ic,
575575
*/
576576
int flb_input_chunk_place_new_chunk(struct flb_input_chunk *ic, size_t chunk_size)
577577
{
578+
int result;
578579
int overlimit;
579580
struct flb_input_instance *i_ins = ic->in;
580581

581582
if (i_ins->storage_type == CIO_STORE_FS) {
582583
overlimit = flb_input_chunk_has_overlimit_routes(ic, chunk_size);
583584
if (overlimit != 0) {
584-
flb_input_chunk_find_space_new_data(ic, chunk_size, overlimit);
585+
result = flb_input_chunk_find_space_new_data(ic, chunk_size, overlimit);
586+
587+
if (result != 0) {
588+
return 0;
589+
}
585590
}
586591
}
587592
return !flb_routes_mask_is_empty(ic->routes_mask);

0 commit comments

Comments
 (0)