From patchwork Fri Nov 16 08:32:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3/3] utilities: kernelscan: swap calloc arguments in unget_next() Date: Thu, 15 Nov 2012 22:32:56 -0000 From: Colin King X-Patchwork-Id: 199516 Message-Id: <1353054776-4856-4-git-send-email-colin.king@canonical.com> To: fwts-devel@lists.ubuntu.com From: Colin Ian King 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 Acked-by: Alex Hung Acked-by: Keng-Yu Lin --- 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); }