diff options
| author | David Brownell <dbrownell@users.sourceforge.net> | 2009-12-26 10:22:28 -0800 |
|---|---|---|
| committer | David Brownell <dbrownell@users.sourceforge.net> | 2009-12-26 10:22:28 -0800 |
| commit | 396b0f3012955f21d7932d958fc7547532cdc90a (patch) | |
| tree | aba71be3b1f6c9642b6a4ba4f47a30a703e82dfd | |
| parent | 08a890e4aae307d874bd617f4dc742a56f2064a2 (diff) | |
| download | openocd+libswd-396b0f3012955f21d7932d958fc7547532cdc90a.tar.gz openocd+libswd-396b0f3012955f21d7932d958fc7547532cdc90a.tar.bz2 openocd+libswd-396b0f3012955f21d7932d958fc7547532cdc90a.tar.xz openocd+libswd-396b0f3012955f21d7932d958fc7547532cdc90a.zip | |
NOR: Allocate the right amount of memory
Switch to calloc() to simplify review and initialization.
| -rw-r--r-- | src/flash/nor/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/flash/nor/core.c b/src/flash/nor/core.c index 67fd78bf..fe5372b6 100644 --- a/src/flash/nor/core.c +++ b/src/flash/nor/core.c @@ -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) |
