mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
perf tools: Fix a memory leak in __open_dso()
The 'name' variable should be freed on the error path. Signed-off-by: Namhyung Kim <[email protected]> Acked-by: Jiri Olsa <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: David Ahern <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Wang Nan <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
parent
3619ef76b3
commit
44ad6b8852
1 changed files with 3 additions and 1 deletions
|
|
@ -412,8 +412,10 @@ static int __open_dso(struct dso *dso, struct machine *machine)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!is_regular_file(name))
|
||||
if (!is_regular_file(name)) {
|
||||
free(name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
fd = do_open(name);
|
||||
free(name);
|
||||
|
|
|
|||
Loading…
Reference in a new issue