| From | Namhyung Kim <> | Subject | [PATCH 07/11] parse-events: Do not call add_event() again if allocation failed | Date | Mon, 23 Apr 2012 13:58:34 +0900 |
| |
When memory allocation for the field name is failed, do not goto event_failed since we added the event already.
Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> --- parse-events.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/parse-events.c b/parse-events.c index 3b39923..52cf331 100644 --- a/parse-events.c +++ b/parse-events.c @@ -4637,7 +4637,8 @@ int pevent_parse_event(struct pevent *pevent, arg->field.name = strdup(field->name); if (!arg->field.name) { do_warning("failed to allocate field name"); - goto event_failed; + event->flags |= EVENT_FL_FAILED; + return -1; } arg->field.field = field; } -- 1.7.10
|