File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -518,6 +518,11 @@ int flb_input_set_collector_time(struct flb_input_instance *in,
518518 struct flb_input_collector * collector ;
519519
520520 collector = flb_malloc (sizeof (struct flb_input_collector ));
521+ if (!collector ) {
522+ flb_errno ();
523+ return -1 ;
524+ }
525+
521526 collector -> id = collector_id (in );
522527 collector -> type = FLB_COLLECT_TIME ;
523528 collector -> cb_collect = cb_collect ;
@@ -543,6 +548,11 @@ int flb_input_set_collector_event(struct flb_input_instance *in,
543548 struct flb_input_collector * collector ;
544549
545550 collector = flb_malloc (sizeof (struct flb_input_collector ));
551+ if (!collector ) {
552+ flb_errno ();
553+ return -1 ;
554+ }
555+
546556 collector -> id = collector_id (in );
547557 collector -> type = FLB_COLLECT_FD_EVENT ;
548558 collector -> cb_collect = cb_collect ;
@@ -791,6 +801,11 @@ int flb_input_set_collector_socket(struct flb_input_instance *in,
791801 struct flb_input_collector * collector ;
792802
793803 collector = flb_malloc (sizeof (struct flb_input_collector ));
804+ if (!collector ) {
805+ flb_errno ();
806+ return -1 ;
807+ }
808+
794809 collector -> type = FLB_COLLECT_FD_SERVER ;
795810 collector -> cb_collect = cb_new_connection ;
796811 collector -> fd_event = fd ;
You can’t perform that action at this time.
0 commit comments