Message ID | 1456132275-98875-21-git-send-email-wangnan0@huawei.com |
---|---|
State | New |
Headers | show |
diff --git a/tools/perf/util/ordered-events.c b/tools/perf/util/ordered-events.c index b1b9e23..70c0dc8 100644 --- a/tools/perf/util/ordered-events.c +++ b/tools/perf/util/ordered-events.c @@ -299,6 +299,8 @@ void ordered_events__init(struct ordered_events *oe, ordered_events__deliver_t d void ordered_events__free(struct ordered_events *oe) { + ordered_events__deliver_t old_deliver = oe->deliver; + while (!list_empty(&oe->to_free)) { struct ordered_event *event; @@ -307,4 +309,7 @@ void ordered_events__free(struct ordered_events *oe) free_dup_event(oe, event->event); free(event); } + + memset(oe, '\0', sizeof(*oe)); + ordered_events__init(oe, old_deliver); }