int retval = fileio_size(&fileio, &filesize);
if (retval != ERROR_OK) {
fileio_close(&fileio);
+ free(buffer);
return retval;
}
target_write_u32(target, 0x200b8010, 0x0);
if (!lpc3180_controller_ready(nand, 1000)) {
- LOG_ERROR(
- "timeout while waiting for completion of auto encode cycle");
+ LOG_ERROR("timeout while waiting for completion of auto encode cycle");
+ free(page_buffer);
+ free(oob_buffer);
return ERROR_NAND_OPERATION_FAILED;
}
}
retval = nand_read_status(nand, &status);
if (retval != ERROR_OK) {
LOG_ERROR("couldn't read status");
+ free(page_buffer);
+ free(oob_buffer);
return ERROR_NAND_OPERATION_FAILED;
}
if (status & NAND_STATUS_FAIL) {
LOG_ERROR("write operation didn't pass, status: 0x%2.2x", status);
+ free(page_buffer);
+ free(oob_buffer);
return ERROR_NAND_OPERATION_FAILED;
}
target_write_u32(target, 0x200b8014, 0xaa55aa55);
if (!lpc3180_controller_ready(nand, 1000)) {
- LOG_ERROR(
- "timeout while waiting for completion of auto decode cycle");
+ LOG_ERROR("timeout while waiting for completion of auto decode cycle");
+ free(page_buffer);
+ free(oob_buffer);
return ERROR_NAND_OPERATION_FAILED;
}
if (mlc_isr & 0x40) {
LOG_ERROR("uncorrectable error detected: 0x%2.2x",
(unsigned)mlc_isr);
+ free(page_buffer);
+ free(oob_buffer);
return ERROR_NAND_OPERATION_FAILED;
}
for (pos = 0; pos < nbytes; pos++)
buffer[pos] = 0xFF;
- if (at91sam7_write(bank, buffer, bank->sectors[first].offset, nbytes) != ERROR_OK)
+ if (at91sam7_write(bank, buffer, bank->sectors[first].offset, nbytes) != ERROR_OK) {
+ free(buffer);
return ERROR_FLASH_OPERATION_FAILED;
+ }
free(buffer);
}
(uint8_t *)&list_thread_count);
if (retval != ERROR_OK) {
LOG_OUTPUT("Error reading number of threads in FreeRTOS thread list\r\n");
+ free(list_of_lists);
return retval;
}
param->pointer_width,
(uint8_t *)&list_elem_ptr);
if (retval != ERROR_OK) {
- LOG_OUTPUT(
- "Error reading first thread item location in FreeRTOS thread list\r\n");
+ LOG_OUTPUT("Error reading first thread item location in FreeRTOS thread list\r\n");
+ free(list_of_lists);
return retval;
}
param->pointer_width,
(uint8_t *)&(rtos->thread_details[tasks_found].threadid));
if (retval != ERROR_OK) {
- LOG_OUTPUT(
- "Error reading thread list item object in FreeRTOS thread list\r\n");
+ LOG_OUTPUT("Error reading thread list item object in FreeRTOS thread list\r\n");
+ free(list_of_lists);
return retval;
}
FREERTOS_THREAD_NAME_STR_SIZE,
(uint8_t *)&tmp_str);
if (retval != ERROR_OK) {
- LOG_OUTPUT(
- "Error reading first thread item location in FreeRTOS thread list\r\n");
+ LOG_OUTPUT("Error reading first thread item location in FreeRTOS thread list\r\n");
+ free(list_of_lists);
return retval;
}
tmp_str[FREERTOS_THREAD_NAME_STR_SIZE-1] = '\x00';
param->pointer_width,
(uint8_t *)&list_elem_ptr);
if (retval != ERROR_OK) {
- LOG_OUTPUT(
- "Error reading next thread item location in FreeRTOS thread list\r\n");
+ LOG_OUTPUT("Error reading next thread item location in FreeRTOS thread list\r\n");
+ free(list_of_lists);
return retval;
}
}
}
+
free(list_of_lists);
rtos->thread_count = tasks_found;
return 0;
} else
LOG_ERROR("fill task: unable to read memory");
+ free(buffer);
+
return retval;
}
int retval;
if (target_get_gdb_reg_list(head->target, ®_list,
- ®_list_size) != ERROR_OK)
+ ®_list_size) != ERROR_OK) {
+ free(buffer);
return ERROR_TARGET_FAILURE;
+ }
if (!reg_list[13]->valid)
reg_list[13]->type->get(reg_list[13]);
head = head->next;
}
+ free(buffer);
+
return ERROR_OK;
}
(uint8_t *) registers);
if (retval != ERROR_OK) {
+ free(buffer);
LOG_ERROR("cpu_context: unable to read memory\n");
return context;
}
if (*thread_info_addr_old == 0xdeadbeef)
*thread_info_addr_old = thread_info_addr_update;
+ free(buffer);
+
return context;
}
if (retval == ERROR_OK) {
uint32_t val = get_buffer(target, buffer);
val = val - NEXT;
- return val;
free(buffer);
+ return val;
} else
LOG_ERROR("next task: unable to read memory");
+ free(buffer);
+
return 0;
}
retval = get_name(target, t);
if (loop > MAX_THREADS) {
+ free(t);
LOG_INFO("more than %d threads !!", MAX_THREADS);
return ERROR_FAIL;
}
(timeval_ms() - start) / linux_os->threadid_count);
LOG_INFO("threadid count %d", linux_os->threadid_count);
+ free(t);
return ERROR_OK;
}
#ifndef PID_CHECK
error_handling:
free(t);
- LOG_ERROR("unable toread pid");
+ LOG_ERROR("unable to read pid");
return;
#endif
}
}
- /* if a packet handler returned an error, exit input loop */
+ /* if a packet handler returned an error, exit input loop */
if (retval != ERROR_OK)
return retval;
}
if (target->rtos->symbols[symbol_num].symbol_name == NULL) {
LOG_OUTPUT("ERROR: unknown symbol\r\n");
gdb_put_packet(connection, "OK", 2);
+ free(hex_name_str);
+ free(name_str);
return ERROR_OK;
}
if ((unsigned int)chars != strlen(separator + 1)) {
LOG_ERROR("gdb sent a packet with wrong register size");
+ free(bin_buf);
return ERROR_SERVER_REMOTE_CLOSED;
}