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
You need to sign in or sign up before continuing.
  • linux
  • tools
  • perf
  • util
  • exec_cmd.c
Find file BlameHistoryPermalink
  • Masami Hiramatsu's avatar
    perf tools: Make perf_exec_path() always return malloc'd string · c4068f51
    Masami Hiramatsu authored Nov 19, 2015
    
    
    Since system_path() returns malloc'd string if given path is not an
    absolute path, perf_exec_path() sometimes returns a static string and
    sometimes returns a malloc'd string depending on the environment
    variables or command options.
    
    This may cause a memory leak because the caller can not unconditionally
    free the returned string.
    
    This fixes perf_exec_path() and system_path() to always return a
    malloc'd string, so the caller can always free it.
    
    Signed-off-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Link: http://lkml.kernel.org/r/20151119060453.14210.65666.stgit@localhost.localdomain
    
    
    Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    c4068f51
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7