diff options
Diffstat (limited to 'tools/perf')
| -rw-r--r-- | tools/perf/util/hist.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 74e307d17c49..f9eb95bf3938 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
| @@ -419,6 +419,13 @@ static int hist_entry__init(struct hist_entry *he, | |||
| 419 | if (he->raw_data == NULL) | 419 | if (he->raw_data == NULL) |
| 420 | goto err_infos; | 420 | goto err_infos; |
| 421 | } | 421 | } |
| 422 | |||
| 423 | if (he->srcline) { | ||
| 424 | he->srcline = strdup(he->srcline); | ||
| 425 | if (he->srcline == NULL) | ||
| 426 | goto err_rawdata; | ||
| 427 | } | ||
| 428 | |||
| 422 | INIT_LIST_HEAD(&he->pairs.node); | 429 | INIT_LIST_HEAD(&he->pairs.node); |
| 423 | thread__get(he->thread); | 430 | thread__get(he->thread); |
| 424 | he->hroot_in = RB_ROOT_CACHED; | 431 | he->hroot_in = RB_ROOT_CACHED; |
| @@ -429,6 +436,9 @@ static int hist_entry__init(struct hist_entry *he, | |||
| 429 | 436 | ||
| 430 | return 0; | 437 | return 0; |
| 431 | 438 | ||
| 439 | err_rawdata: | ||
| 440 | free(he->raw_data); | ||
| 441 | |||
| 432 | err_infos: | 442 | err_infos: |
| 433 | if (he->branch_info) { | 443 | if (he->branch_info) { |
| 434 | map__put(he->branch_info->from.map); | 444 | map__put(he->branch_info->from.map); |
| @@ -605,7 +615,7 @@ __hists__add_entry(struct hists *hists, | |||
| 605 | .map = al->map, | 615 | .map = al->map, |
| 606 | .sym = al->sym, | 616 | .sym = al->sym, |
| 607 | }, | 617 | }, |
| 608 | .srcline = al->srcline ? strdup(al->srcline) : NULL, | 618 | .srcline = (char *) al->srcline, |
| 609 | .socket = al->socket, | 619 | .socket = al->socket, |
| 610 | .cpu = al->cpu, | 620 | .cpu = al->cpu, |
| 611 | .cpumode = al->cpumode, | 621 | .cpumode = al->cpumode, |
| @@ -962,7 +972,7 @@ iter_add_next_cumulative_entry(struct hist_entry_iter *iter, | |||
| 962 | .map = al->map, | 972 | .map = al->map, |
| 963 | .sym = al->sym, | 973 | .sym = al->sym, |
| 964 | }, | 974 | }, |
| 965 | .srcline = al->srcline ? strdup(al->srcline) : NULL, | 975 | .srcline = (char *) al->srcline, |
| 966 | .parent = iter->parent, | 976 | .parent = iter->parent, |
| 967 | .raw_data = sample->raw_data, | 977 | .raw_data = sample->raw_data, |
| 968 | .raw_size = sample->raw_size, | 978 | .raw_size = sample->raw_size, |
