Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263180
b: refs/heads/master
c: cc2d86b
h: refs/heads/master
v: v3
  • Loading branch information
Stephane Eranian authored and Arnaldo Carvalho de Melo committed Aug 18, 2011
1 parent 73d57a4 commit 8805dab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 77e57297b4ff3f602ba5105398d342a4b4a54774
refs/heads/master: cc2d86b04d9ac28a6be6cb05da6ea8f014fd5aa0
11 changes: 10 additions & 1 deletion trunk/tools/perf/util/evlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,19 @@ int perf_evlist__add_default(struct perf_evlist *evlist)
struct perf_evsel *evsel = perf_evsel__new(&attr, 0);

if (evsel == NULL)
return -ENOMEM;
goto error;

/* use strdup() because free(evsel) assumes name is allocated */
evsel->name = strdup("cycles");
if (!evsel->name)
goto error_free;

perf_evlist__add(evlist, evsel);
return 0;
error_free:
perf_evsel__delete(evsel);
error:
return -ENOMEM;
}

void perf_evlist__disable(struct perf_evlist *evlist)
Expand Down

0 comments on commit 8805dab

Please sign in to comment.