Initialize memory before using it. put_bits wants it that way.
authorPatrick Georgi <patrick.georgi@coresystems.de>
Tue, 17 Nov 2009 11:52:18 +0000 (11:52 +0000)
committerPatrick Georgi <patrick.georgi@coresystems.de>
Tue, 17 Nov 2009 11:52:18 +0000 (11:52 +0000)
Trivial.

Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de>
Acked-by: Patrick Georgi <patrick.georgi@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4946 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

util/nvramtool/cmos_lowlevel.c

index 7fd603bd283eac297d2ce9f2ef820fa3af11a4d3..570161b4e0a6650283b8dc3bf50a9033592c6588 100644 (file)
@@ -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(); }