lkml.org 
[lkml]   [2012]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH 4/7] parse-events: Handle strdup failure cases
    Date
    Hi,

    On Mon, 23 Apr 2012 11:51:14 -0400, Steven Rostedt wrote:
    > On Mon, 2012-04-09 at 11:54 +0900, Namhyung Kim wrote:
    >> There were some places didn't check return value of the strdup
    >> and had unneeded/duplicated checks. Fix it.
    >>
    >> Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
    >> ---
    >> parse-events.c | 29 +++++++++++++++++++++++++++--
    >> 1 files changed, 27 insertions(+), 2 deletions(-)
    >>
    >> diff --git a/parse-events.c b/parse-events.c
    >> index 0b1e40a..773c928 100644
    >> --- a/parse-events.c
    >> +++ b/parse-events.c
    >> @@ -463,8 +463,10 @@ int pevent_register_function(struct pevent *pevent, char *func,
    >> item->mod = NULL;
    >> item->addr = addr;
    >>
    >> - pevent->funclist = item;
    >> + if (!item->func || (mod && !item->mod))
    >> + die("malloc func");
    >>
    >
    > I just added this patch, but we need to get rid of all the "die"
    > functions and do proper freeing and error notifications to make this a
    > real library.
    >

    Agreed. I'm planning to dive into it soonish..

    Thanks,
    Namhyung


    \
     
     \ /
      Last update: 2012-04-24 02:39    [W:0.024 / U:59.468 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site