summaryrefslogtreecommitdiff
path: root/src/flash
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2009-12-26 10:22:28 -0800
committerDavid Brownell <dbrownell@users.sourceforge.net>2009-12-26 10:22:28 -0800
commit396b0f3012955f21d7932d958fc7547532cdc90a (patch)
treeaba71be3b1f6c9642b6a4ba4f47a30a703e82dfd /src/flash
parent08a890e4aae307d874bd617f4dc742a56f2064a2 (diff)
downloadopenocd+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.
Diffstat (limited to 'src/flash')
-rw-r--r--src/flash/nor/core.c2
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)