On 11/19/2010 04:14 PM, Ivana Hutarova Varekova wrote:
> there is no sense to read the data for cgroup which was not found
>
> Signed-off-by: Ivana Hutarova Varekova<[email protected]>
> ---
>
>   src/tools/cgsnapshot.c |    2 ++
>   1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/src/tools/cgsnapshot.c b/src/tools/cgsnapshot.c
> index 2b5e2df..198fdd7 100644
> --- a/src/tools/cgsnapshot.c
> +++ b/src/tools/cgsnapshot.c
> @@ -464,6 +464,7 @@ static int display_controller_data(
>                       if (ret != 0) {
>                               printf("cannot read group '%s': %s\n",
>                               cgroup_name, cgroup_strerror(ret));
> +                             goto err;
>                       }
>
>                       display_cgroup_data(group, controller, info.full_path,
> @@ -474,6 +475,7 @@ static int display_controller_data(
>
>       cgroup_free(&group);
>
> +err:

Looking at the code I can see only the last group created in the loop is 
freed... the cgroup_free(&group) belongs to the loop, not out of it This 
is a separate bug, so...:

Acked-by: Jan Safranek <[email protected]>

>       cgroup_walk_tree_end(&handle);
>       if (ret == ECGEOF)
>               ret = 0;
>
>
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2&  L3.
> Spend less time writing and  rewriting code and more time creating great
> experiences on the web. Be a part of the beta today
> http://p.sf.net/sfu/msIE9-sfdev2dev
> _______________________________________________
> Libcg-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/libcg-devel
>


------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to