Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • lib
  • kunit
  • executor.c
Find file BlameHistoryPermalink
  • Jinjie Ruan's avatar
    kunit: Fix possible memory leak in kunit_filter_suites() · 24de14c9
    Jinjie Ruan authored Sep 27, 2023
    If the outer layer for loop is iterated more than once and it fails not
    in the first iteration, the filtered_suite and filtered_suite->test_cases
    allocated in the last kunit_filter_attr_tests() in last inner for loop
    is leaked.
    
    So add a new free_filtered_suite err label and free the filtered_suite
    and filtered_suite->test_cases so far. And change kmalloc_array of copy
    to kcalloc to Clear the copy to make the kfree safe.
    
    Fixes: 529534e8
    
     ("kunit: Add ability to filter attributes")
    Signed-off-by: default avatarJinjie Ruan <ruanjinjie@huawei.com>
    Reviewed-by: default avatarRae Moar <rmoar@google.com>
    Reviewed-by: default avatarDavid Gow <davidgow@google.com>
    Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
    24de14c9
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7