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

Colin King colin.king at canonical.com
Fri Nov 16 08:32:56 UTC 2012


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);
 	}
-- 
1.7.10.4




More information about the fwts-devel mailing list