From 61c6aec071e47312aa39f6e0e1edf284f96e7c69 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Tue, 17 Nov 2009 11:52:18 +0000 Subject: Initialize memory before using it. put_bits wants it that way. Trivial. Signed-off-by: Patrick Georgi Acked-by: Patrick Georgi git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4946 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/nvramtool/cmos_lowlevel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/nvramtool/cmos_lowlevel.c b/util/nvramtool/cmos_lowlevel.c index 7fd603bd28..570161b4e0 100644 --- a/util/nvramtool/cmos_lowlevel.c +++ b/util/nvramtool/cmos_lowlevel.c @@ -93,7 +93,7 @@ unsigned long long cmos_read (const cmos_entry_t *e) result = 0; if (e->config == CMOS_ENTRY_STRING) - { char *newstring = malloc((length+7)/8); + { char *newstring = calloc(1, (length+7)/8); unsigned usize = (8 * sizeof(unsigned long long)); if(!newstring) { out_of_memory(); } -- cgit v1.2.3