Don't cast return value of [cm]alloc

Change-Id: I0028a5b6757b1ba00031893d9a2a1725f915a0d5
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/2069
Tested-by: jenkins
Reviewed-by: Jörg Wunsch <openocd@uriah.heep.sax.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
This commit is contained in:
Andreas Fritiofson
2014-03-28 20:00:21 +01:00
committed by Paul Fertser
parent 1171f07836
commit e6907e6d7e
14 changed files with 76 additions and 76 deletions

View File

@@ -3190,7 +3190,7 @@ static COMMAND_HELPER(handle_verify_image_command_internal, int verify)
if (diffs == 0)
LOG_ERROR("checksum mismatch - attempting binary compare");
data = (uint8_t *)malloc(buf_cnt);
data = malloc(buf_cnt);
/* Can we use 32bit word accesses? */
int size = 1;
@@ -5102,7 +5102,7 @@ static int target_create(Jim_GetOptInfo *goi)
target->target_number = new_target_number();
/* allocate memory for each unique target type */
target->type = (struct target_type *)calloc(1, sizeof(struct target_type));
target->type = calloc(1, sizeof(struct target_type));
memcpy(target->type, target_types[x], sizeof(struct target_type));
@@ -5488,7 +5488,7 @@ COMMAND_HANDLER(handle_fast_load_image_command)
image_size = 0x0;
retval = ERROR_OK;
fastload_num = image.num_sections;
fastload = (struct FastLoad *)malloc(sizeof(struct FastLoad)*image.num_sections);
fastload = malloc(sizeof(struct FastLoad)*image.num_sections);
if (fastload == NULL) {
command_print(CMD_CTX, "out of memory");
image_close(&image);