File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -281,6 +281,8 @@ static void policy_unpack_test_unpack_strdup_with_null_name(struct kunit *test)
281281 ((uintptr_t )puf -> e -> start <= (uintptr_t )string )
282282 && ((uintptr_t )string <= (uintptr_t )puf -> e -> end ));
283283 KUNIT_EXPECT_STREQ (test , string , TEST_STRING_DATA );
284+
285+ kfree (string );
284286}
285287
286288static void policy_unpack_test_unpack_strdup_with_name (struct kunit * test )
@@ -296,6 +298,8 @@ static void policy_unpack_test_unpack_strdup_with_name(struct kunit *test)
296298 ((uintptr_t )puf -> e -> start <= (uintptr_t )string )
297299 && ((uintptr_t )string <= (uintptr_t )puf -> e -> end ));
298300 KUNIT_EXPECT_STREQ (test , string , TEST_STRING_DATA );
301+
302+ kfree (string );
299303}
300304
301305static void policy_unpack_test_unpack_strdup_out_of_bounds (struct kunit * test )
@@ -313,6 +317,8 @@ static void policy_unpack_test_unpack_strdup_out_of_bounds(struct kunit *test)
313317 KUNIT_EXPECT_EQ (test , size , 0 );
314318 KUNIT_EXPECT_NULL (test , string );
315319 KUNIT_EXPECT_PTR_EQ (test , puf -> e -> pos , start );
320+
321+ kfree (string );
316322}
317323
318324static void policy_unpack_test_unpack_nameX_with_null_name (struct kunit * test )
You can’t perform that action at this time.
0 commit comments