Commit d72e5cf
perf sched: Fix memory leaks in __cmd_record detected with -fsanitize=address
An array of strings is passed to cmd_record but not freed. As
cmd_record modifies the array, add another array as a copy that can be
mutated allowing the original array contents to all be freed.
Detected with -fsanitize=address.
Signed-off-by: Ian Rogers <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>1 parent e89eaa6 commit d72e5cf
1 file changed
+19
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3355 | 3355 | | |
3356 | 3356 | | |
3357 | 3357 | | |
3358 | | - | |
| 3358 | + | |
| 3359 | + | |
3359 | 3360 | | |
3360 | 3361 | | |
3361 | 3362 | | |
| |||
3384 | 3385 | | |
3385 | 3386 | | |
3386 | 3387 | | |
| 3388 | + | |
3387 | 3389 | | |
3388 | 3390 | | |
3389 | 3391 | | |
3390 | 3392 | | |
3391 | 3393 | | |
3392 | 3394 | | |
3393 | 3395 | | |
3394 | | - | |
3395 | 3396 | | |
3396 | 3397 | | |
| 3398 | + | |
| 3399 | + | |
| 3400 | + | |
| 3401 | + | |
| 3402 | + | |
3397 | 3403 | | |
3398 | 3404 | | |
3399 | 3405 | | |
3400 | 3406 | | |
3401 | | - | |
| 3407 | + | |
3402 | 3408 | | |
3403 | 3409 | | |
3404 | 3410 | | |
| |||
3409 | 3415 | | |
3410 | 3416 | | |
3411 | 3417 | | |
3412 | | - | |
| 3418 | + | |
3413 | 3419 | | |
3414 | 3420 | | |
3415 | 3421 | | |
3416 | | - | |
| 3422 | + | |
| 3423 | + | |
| 3424 | + | |
| 3425 | + | |
| 3426 | + | |
| 3427 | + | |
| 3428 | + | |
| 3429 | + | |
| 3430 | + | |
3417 | 3431 | | |
3418 | 3432 | | |
3419 | 3433 | | |
| |||
0 commit comments