Commit a37338a
perf report: Free generated help strings for sort option
ASan reports the memory leak of the strings allocated by sort_help() when
running perf report.
This patch changes the returned pointer to char* (instead of const
char*), saves it in a temporary variable, and finally deallocates it at
function exit.
Signed-off-by: Riccardo Mancini <rickyman7@gmail.com>
Fixes: 702fb9b ("perf report: Show all sort keys in help output")
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/a38b13f02812a8a6759200b9063c6191337f44d4.1626343282.git.rickyman7@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>1 parent da6b7c6 commit a37338a
3 files changed
+24
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1175 | 1175 | | |
1176 | 1176 | | |
1177 | 1177 | | |
| 1178 | + | |
| 1179 | + | |
1178 | 1180 | | |
1179 | 1181 | | |
1180 | 1182 | | |
| |||
1209 | 1211 | | |
1210 | 1212 | | |
1211 | 1213 | | |
1212 | | - | |
| 1214 | + | |
1213 | 1215 | | |
1214 | | - | |
| 1216 | + | |
1215 | 1217 | | |
1216 | 1218 | | |
1217 | 1219 | | |
| |||
1344 | 1346 | | |
1345 | 1347 | | |
1346 | 1348 | | |
1347 | | - | |
| 1349 | + | |
1348 | 1350 | | |
1349 | 1351 | | |
1350 | 1352 | | |
1351 | | - | |
| 1353 | + | |
1352 | 1354 | | |
1353 | 1355 | | |
1354 | 1356 | | |
| |||
1362 | 1364 | | |
1363 | 1365 | | |
1364 | 1366 | | |
1365 | | - | |
1366 | | - | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
1367 | 1371 | | |
1368 | 1372 | | |
1369 | 1373 | | |
| |||
1377 | 1381 | | |
1378 | 1382 | | |
1379 | 1383 | | |
1380 | | - | |
| 1384 | + | |
| 1385 | + | |
1381 | 1386 | | |
1382 | 1387 | | |
1383 | 1388 | | |
1384 | 1389 | | |
1385 | | - | |
| 1390 | + | |
| 1391 | + | |
1386 | 1392 | | |
1387 | 1393 | | |
1388 | 1394 | | |
| |||
1406 | 1412 | | |
1407 | 1413 | | |
1408 | 1414 | | |
1409 | | - | |
1410 | | - | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
1411 | 1419 | | |
1412 | 1420 | | |
1413 | 1421 | | |
1414 | | - | |
| 1422 | + | |
1415 | 1423 | | |
1416 | 1424 | | |
1417 | 1425 | | |
| |||
1646 | 1654 | | |
1647 | 1655 | | |
1648 | 1656 | | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
1649 | 1660 | | |
1650 | 1661 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3370 | 3370 | | |
3371 | 3371 | | |
3372 | 3372 | | |
3373 | | - | |
| 3373 | + | |
3374 | 3374 | | |
3375 | 3375 | | |
3376 | 3376 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
305 | | - | |
| 305 | + | |
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| |||
0 commit comments