[coreboot-gerrit] New patch to review for coreboot: util/cbmem: Use `calloc()` instead of `malloc()`

Paul Menzel (paulepanter@users.sourceforge.net) gerrit at coreboot.org
Thu Jun 18 08:13:17 CEST 2015


Paul Menzel (paulepanter at users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10571

-gerrit

commit ff1afbbde90957845b581024441a655353dbfadf
Author: Aaron Durbin <adurbin at chromium.org>
Date:   Wed Jun 17 16:22:00 2015 +0200

    util/cbmem: Use `calloc()` instead of `malloc()`
    
    Change-Id: Ib24c9c269c3a9d38ab879a857e0bd4861982bd79
    Signed-off-by: Aaron Durbin <adurbin at chromium.org>
    Signed-off-by: Paul Menzel <paulepanter at users.sourceforge.net>
---
 util/cbmem/cbmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/cbmem/cbmem.c b/util/cbmem/cbmem.c
index 3bc0fcd..f3366f3 100644
--- a/util/cbmem/cbmem.c
+++ b/util/cbmem/cbmem.c
@@ -539,7 +539,7 @@ static void dump_console(void)
 	 */
 	if (size > cursor)
 		size = cursor;
-	console_c = malloc(size + 1);
+	console_c = calloc(1, size + 1);
 	unmap_memory();
 	if (!console_c) {
 		fprintf(stderr, "Not enough memory for console.\n");



More information about the coreboot-gerrit mailing list