diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/perf/util/dso.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index 51cf82cf1882..8ee1faa5726f 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c | |||
| @@ -468,6 +468,7 @@ static int __open_dso(struct dso *dso, struct machine *machine) | |||
| 468 | int fd = -EINVAL; | 468 | int fd = -EINVAL; |
| 469 | char *root_dir = (char *)""; | 469 | char *root_dir = (char *)""; |
| 470 | char *name = malloc(PATH_MAX); | 470 | char *name = malloc(PATH_MAX); |
| 471 | bool decomp = false; | ||
| 471 | 472 | ||
| 472 | if (!name) | 473 | if (!name) |
| 473 | return -ENOMEM; | 474 | return -ENOMEM; |
| @@ -491,12 +492,13 @@ static int __open_dso(struct dso *dso, struct machine *machine) | |||
| 491 | goto out; | 492 | goto out; |
| 492 | } | 493 | } |
| 493 | 494 | ||
| 495 | decomp = true; | ||
| 494 | strcpy(name, newpath); | 496 | strcpy(name, newpath); |
| 495 | } | 497 | } |
| 496 | 498 | ||
| 497 | fd = do_open(name); | 499 | fd = do_open(name); |
| 498 | 500 | ||
| 499 | if (dso__needs_decompress(dso)) | 501 | if (decomp) |
| 500 | unlink(name); | 502 | unlink(name); |
| 501 | 503 | ||
| 502 | out: | 504 | out: |
