Re: [PATCH 3/7] perf lock: plug some memleaks

From: Hitoshi Mitake
Date: Wed Sep 18 2013 - 13:39:30 EST


At Mon, 9 Sep 2013 08:31:38 +0530,
Ramkumar Ramachandra wrote:
>
> Davidlohr Bueso wrote:
> > diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
> > index d318862..7784347 100644
> > --- a/tools/perf/builtin-lock.c
> > +++ b/tools/perf/builtin-lock.c
> > @@ -321,10 +321,12 @@ static struct lock_stat *lock_stat_findnew(void *addr, const char *name)
> >
> > new->addr = addr;
> > new->name = zalloc(sizeof(char) * strlen(name) + 1);
> > - if (!new->name)
> > + if (!new->name) {
> > + free(new);
> > goto alloc_failed;
> > - strcpy(new->name, name);
> > + }
>
> Why is the strcpy() missing indent?

The strcpy() is removed. It doesn't miss indantation.

Thanks,
Hitoshi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/