Skip to content

Commit f9c5924

Browse files
pwhelanedsiper
authored andcommitted
tests/filter_grep: do not stop if unable start to avoid calling pthread_join on an invalid tid.
Signed-off-by: Phillip Adair Stewart Whelan <[email protected]>
1 parent a5d48b0 commit f9c5924

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tests/runtime/filter_grep.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ void flb_test_filter_grep_invalid(void)
181181
TEST_CHECK(bytes == -1);
182182
}
183183

184-
flb_stop(ctx);
184+
if (ret == 0) {
185+
flb_stop(ctx);
186+
}
185187
flb_destroy(ctx);
186188
}
187189

@@ -484,7 +486,9 @@ void flb_test_error_AND_regex_exclude(void)
484486
ret = flb_start(ctx);
485487
TEST_CHECK(ret != 0);
486488

487-
flb_stop(ctx);
489+
if (ret == 0) {
490+
flb_stop(ctx);
491+
}
488492
flb_destroy(ctx);
489493
}
490494

@@ -520,7 +524,9 @@ void flb_test_error_OR_regex_exclude(void)
520524
ret = flb_start(ctx);
521525
TEST_CHECK(ret != 0);
522526

523-
flb_stop(ctx);
527+
if (ret == 0) {
528+
flb_stop(ctx);
529+
}
524530
flb_destroy(ctx);
525531
}
526532

0 commit comments

Comments
 (0)