perf hist: Add missing map__put() in error case
[linux-2.6-microblaze.git] / tools / perf / util / hist.c
index 1f23028..7ace7a1 100644 (file)
@@ -1111,8 +1111,10 @@ int hist_entry_iter__add(struct hist_entry_iter *iter, struct addr_location *al,
 
        err = sample__resolve_callchain(iter->sample, &callchain_cursor, &iter->parent,
                                        iter->evsel, al, max_stack_depth);
-       if (err)
+       if (err) {
+               map__put(alm);
                return err;
+       }
 
        err = iter->ops->prepare_entry(iter, al);
        if (err)