On Thu, May 21, 2009 at 12:05:42PM +0200, Ivana Varekova wrote:
> parse_cgroup_spec function does not initializesd allocated memory
> this patch allocate it to zero so there is no problem with uninitialized
> values.
>
> Signed-off-by: Ivana Varekova <[email protected]>
looks good! Thanks ivana!
> ---
>
> src/tools/tools-common.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/src/tools/tools-common.c b/src/tools/tools-common.c
> index 0bb666f..b80ae3c 100644
> --- a/src/tools/tools-common.c
> +++ b/src/tools/tools-common.c
> @@ -56,7 +56,7 @@ int parse_cgroup_spec(struct cgroup_group_spec *cdptr[],
> char *optarg)
> return -1;
>
> /* instanciate cgroup_data. */
> - cdptr[i] = malloc(sizeof(struct cgroup_group_spec));
> + cdptr[i] = calloc(1, sizeof(struct cgroup_group_spec));
> if (!cdptr[i]) {
> fprintf(stderr, "%s\n", strerror(errno));
> return -1;
>
--
regards,
Dhaval
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel