Since r is a pointer, memset(r, 0, sizeof(r)) would only zero the first 4 (or 8) bytes of the newly allocated struct align_region_t. An alternative to this patch would be to use calloc, or introduce a new zalloc (zeroed allocation; a single-element calloc) and use that. Change-Id: Ic3e3487ce749eeebf6c4836e62b8a305ad766e7e Found-by: Coverity (ID 1291160) Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Reviewed-on: https://review.coreboot.org/14244 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> |
||
|---|---|---|
| .. | ||
| 64bit_div.c | ||
| args.c | ||
| console.c | ||
| coreboot.c | ||
| ctype.c | ||
| die.c | ||
| exec.c | ||
| fmap.c | ||
| getopt_long.c | ||
| hexdump.c | ||
| ipchecksum.c | ||
| lib.c | ||
| libgcc.c | ||
| Makefile.inc | ||
| malloc.c | ||
| memory.c | ||
| printf.c | ||
| qsort.c | ||
| rand.c | ||
| readline.c | ||
| string.c | ||
| strlcpy.c | ||
| sysinfo.c | ||
| time.c | ||