On 10/08/2013 08:10 AM, Ivana Hutarova Varekova wrote:
> There is unnecessary test "Is the variable NULL?" after we already NULL it.
>
>
> Signed-off-by: Ivana Hutarova Varekova <varek...@redhat.com>
Acked-by: Peter Schiffer <pschi...@redhat.com>
> ---
>
>   src/api.c |   14 +++++---------
>   1 files changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/src/api.c b/src/api.c
> index d5d0ce7..5e39efb 100644
> --- a/src/api.c
> +++ b/src/api.c
> @@ -2776,16 +2776,14 @@ static int cgroup_create_template_group(char 
> *orig_group_name,
>       /* template name and group name have to have '/' sign at the end */
>       template_name = cgroup_copy_with_slash(tmp->destination);
>       if (template_name == NULL) {
> -             ret = ECGOTHER;
>               last_errno = errno;
> -             goto end;
> +             return ECGOTHER;
>       }
>       group_name = cgroup_copy_with_slash(orig_group_name);
>       if (group_name == NULL) {
> -             ret = ECGOTHER;
>               last_errno = errno;
>               free(template_name);
> -             goto end;
> +             return ECGOTHER;
>       }
>
>       /* set start positions */
> @@ -2850,11 +2848,9 @@ while_end:
>       if ((group_position != NULL) && (group_position[0] == '\0'))
>               group_position[0] = '/';
>
> -end:
> -     if (group_name != NULL)
> -             free(group_name);
> -     if (template_name != NULL)
> -             free(template_name);
> +     free(group_name);
> +     free(template_name);
> +
>       return ret;
>   }
>
>
>
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
> _______________________________________________
> Libcg-devel mailing list
> Libcg-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libcg-devel
>


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to