mirror of
git://git.code.sf.net/p/openocd/code
synced 2025-07-19 10:08:37 +10:00
NOR: Allocate the right amount of memory
Switch to calloc() to simplify review and initialization.
This commit is contained in:
parent
08a890e4aa
commit
396b0f3012
@ -401,7 +401,7 @@ int flash_write_unlock(struct target *target, struct image *image,
|
||||
}
|
||||
|
||||
/* allocate padding array */
|
||||
padding = malloc(image->num_sections * sizeof(padding));
|
||||
padding = calloc(image->num_sections, sizeof(*padding));
|
||||
|
||||
/* loop until we reach end of the image */
|
||||
while (section < image->num_sections)
|
||||
|
Loading…
Reference in New Issue
Block a user