ACK: [PATCH 3/3] utilities: kernelscan: swap calloc arguments in unget_next()

Alex Hung alex.hung at canonical.com
Thu Nov 22 03:01:47 UTC 2012


On 11/16/2012 04:32 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> In unget_next() we should be allocating 1 lot of get_stack sized
> memory rather than get_stack sized lots of bytes. Not that it makes
> much difference, but fix the order anyhow.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>   src/utilities/kernelscan.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/utilities/kernelscan.c b/src/utilities/kernelscan.c
> index 7b12f83..d966f03 100644
> --- a/src/utilities/kernelscan.c
> +++ b/src/utilities/kernelscan.c
> @@ -147,7 +147,7 @@ static void unget_next(parser *p, int ch)
>   {
>   	get_stack *new;
>
> -	if ((new = calloc(sizeof(get_stack), 1)) == NULL) {
> +	if ((new = calloc(1, sizeof(get_stack))) == NULL) {
>   		fprintf(stderr, "unget_next: Out of memory!\n");
>   		exit(EXIT_FAILURE);
>   	}
>
Acked-by: Alex Hung <alex.hung at canonical.com>



More information about the fwts-devel mailing list