X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=tools%2Fperf%2Futil%2Fmachine.c;h=a0c186acb1f3ee5b9be6c8878cb74bd181a77644;hb=b8ab92201a64886fd3d8078fe46e51f658379823;hp=b1772180c82078150ff31196e1862e0c76e1d086;hpb=6b15d6650c5301ce023d8df0cc3a60b1a76d377e;p=cascardo%2Flinux.git diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index b1772180c820..a0c186acb1f3 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -1353,11 +1353,16 @@ int machine__process_mmap2_event(struct machine *machine, if (map == NULL) goto out_problem_map; - thread__insert_map(thread, map); + ret = thread__insert_map(thread, map); + if (ret) + goto out_problem_insert; + thread__put(thread); map__put(map); return 0; +out_problem_insert: + map__put(map); out_problem_map: thread__put(thread); out_problem: @@ -1403,11 +1408,16 @@ int machine__process_mmap_event(struct machine *machine, union perf_event *event if (map == NULL) goto out_problem_map; - thread__insert_map(thread, map); + ret = thread__insert_map(thread, map); + if (ret) + goto out_problem_insert; + thread__put(thread); map__put(map); return 0; +out_problem_insert: + map__put(map); out_problem_map: thread__put(thread); out_problem: