[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5229E11D.9080407@gmail.com>
Date: Fri, 06 Sep 2013 08:05:17 -0600
From: David Ahern <dsahern@...il.com>
To: Namhyung Kim <namhyung@...nel.org>
CC: Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Paul Mackerras <paulus@...ba.org>,
Ingo Molnar <mingo@...nel.org>,
Namhyung Kim <namhyung.kim@....com>,
LKML <linux-kernel@...r.kernel.org>, Jiri Olsa <jolsa@...hat.com>
Subject: Re: [PATCH] perf tools: Free strlist in strlist__delete()
On 9/5/13 11:35 PM, Namhyung Kim wrote:
> From: Namhyung Kim <namhyung.kim@....com>
>
> It seems strlist never deleted after allocated. AFAICS every strlist
> is allocated dynamically, just free it in the _delete() function.
>
> Signed-off-by: Namhyung Kim <namhyung@...nel.org>
> ---
> tools/perf/util/strlist.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/strlist.c b/tools/perf/util/strlist.c
> index eabdce0a2daa..11593d899eb2 100644
> --- a/tools/perf/util/strlist.c
> +++ b/tools/perf/util/strlist.c
> @@ -155,8 +155,10 @@ out_error:
>
> void strlist__delete(struct strlist *slist)
> {
> - if (slist != NULL)
> + if (slist != NULL) {
> rblist__delete(&slist->rblist);
> + free(slist);
> + }
> }
>
> struct str_node *strlist__entry(const struct strlist *slist, unsigned int idx)
>
Yes, strlist__delete is the counterpart to strlist__new; the new
function allocates the memory, so the delete should free it.
Acked-by: David Ahern <dsahern@...il.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists