Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323775
b: refs/heads/master
c: 0ca8da0
h: refs/heads/master
i:
  323773: bd2093c
  323771: 6c46d5a
  323767: b76f516
  323759: c5ba90a
  323743: 3356d7f
  323711: 2fe4743
v: v3
  • Loading branch information
Namhyung Kim authored and Arnaldo Carvalho de Melo committed Sep 7, 2012
1 parent bfa94dc commit a220519
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 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: 245c5a18433090da0e1a799bdb0faa78552b5992
refs/heads/master: 0ca8da00ad170c12c12350c3a2500591a7bec535
13 changes: 11 additions & 2 deletions trunk/tools/lib/traceevent/event-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -5183,7 +5183,12 @@ int pevent_register_event_handler(struct pevent *pevent,

not_found:
/* Save for later use. */
handle = malloc_or_die(sizeof(*handle));
handle = malloc(sizeof(*handle));
if (!handle) {
do_warning("Failed to allocate event handler");
return PEVENT_ERRNO__MEM_ALLOC_FAILED;
}

memset(handle, 0, sizeof(*handle));
handle->id = id;
if (event_name)
Expand All @@ -5193,7 +5198,11 @@ int pevent_register_event_handler(struct pevent *pevent,

if ((event_name && !handle->event_name) ||
(sys_name && !handle->sys_name)) {
die("Failed to allocate event/sys name");
do_warning("Failed to allocate event/sys name");
free((void *)handle->event_name);
free((void *)handle->sys_name);
free(handle);
return PEVENT_ERRNO__MEM_ALLOC_FAILED;
}

handle->func = func;
Expand Down

0 comments on commit a220519

Please sign in to comment.