Browse Source

NOR: Allocate the right amount of memory

Switch to calloc() to simplify review and initialization.
tags/v0.4.0-rc2
David Brownell 14 years ago
parent
commit
396b0f3012
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/flash/nor/core.c

+ 1
- 1
src/flash/nor/core.c View File

@@ -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…
Cancel
Save