Re: [PATCH] kconfig: Fix compiler warning

From: Michal Marek
Date: Fri Nov 28 2014 - 08:19:23 EST


On 2014-11-20 06:44, Eddie Kovsky wrote:
> diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
> index a26cc5d2a9b0..a728d23949e7 100644
> --- a/scripts/kconfig/menu.c
> +++ b/scripts/kconfig/menu.c
> @@ -559,8 +559,8 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
> if (location == NULL && accessible)
> location = menu;
> }
> + jump = xmalloc(sizeof(*jump));
> if (head && location) {
> - jump = xmalloc(sizeof(struct jump_key));

This creates a memory leak, because 'jump' is allocated, but not added
to the list, if the following condition is not met.

Michal

--
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/