lkml.org 
[lkml]   [2012]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 07/11] parse-events: Do not call add_event() again if allocation failed
    Date
    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


    \
     
     \ /
      Last update: 2012-04-23 07:55    [W:0.023 / U:0.644 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site