linux/lib/kunit
Jinjie Ruan 9076bc476d kunit: Fix possible memory leak in kunit_filter_suites()
If both filter_glob and filters are not NULL, and kunit_parse_glob_filter()
succeed, but kcalloc parsed_filters fails, the suite_glob and test_glob of
parsed kzalloc in kunit_parse_glob_filter() will be leaked.

As Rae suggested, assign -ENOMEM to *err to correctly free copy and goto
free_parsed_glob to free the suite/test_glob of parsed.

Fixes: 1c9fd080df ("kunit: fix uninitialized variables bug in attributes filtering")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Suggested-by: Rae Moar <rmoar@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2023-09-05 12:30:06 -06:00
..
.kunitconfig
Kconfig kunit: Allow kunit test modules to use test filtering 2023-08-08 13:46:18 -06:00
Makefile
assert.c
attributes.c kunit: fix struct kunit_attr header 2023-08-21 08:07:56 -06:00
debugfs.c
debugfs.h
executor.c kunit: Fix possible memory leak in kunit_filter_suites() 2023-09-05 12:30:06 -06:00
executor_test.c kunit: test: Make filter strings in executor_test writable 2023-09-01 09:09:25 -06:00
hooks-impl.h
hooks.c
kunit-example-test.c
kunit-test.c
resource.c
static_stub.c
string-stream-test.c
string-stream.c
string-stream.h
test.c kunit: Fix wild-memory-access bug in kunit_free_suite_set() 2023-09-05 12:29:50 -06:00
try-catch-impl.h
try-catch.c