Skip to content

Commit 166c936

Browse files
leonardo-albertovichedsiper
authored andcommitted
input_thread: added missing sanity check
Signed-off-by: Leonardo Alminana <[email protected]>
1 parent 01a2bdf commit 166c936

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/flb_input_thread.c

+12
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,10 @@ int flb_input_thread_instance_pause(struct flb_input_instance *ins)
510510
uint64_t val;
511511
struct flb_input_thread_instance *thi = ins->thi;
512512

513+
if (thi == NULL) {
514+
return 0;
515+
}
516+
513517
flb_plg_debug(ins, "thread pause instance");
514518

515519
/* compose message to pause the thread */
@@ -535,6 +539,10 @@ int flb_input_thread_instance_resume(struct flb_input_instance *ins)
535539
uint64_t val;
536540
struct flb_input_thread_instance *thi = ins->thi;
537541

542+
if (thi == NULL) {
543+
return 0;
544+
}
545+
538546
flb_plg_debug(ins, "thread resume instance");
539547

540548
/* compose message to resume the thread */
@@ -557,6 +565,10 @@ int flb_input_thread_instance_exit(struct flb_input_instance *ins)
557565
struct flb_input_thread_instance *thi = ins->thi;
558566
pthread_t tid;
559567

568+
if (thi == NULL) {
569+
return 0;
570+
}
571+
560572
memcpy(&tid, &thi->th->tid, sizeof(pthread_t));
561573

562574
/* compose message to pause the thread */

0 commit comments

Comments
 (0)