mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-01 03:34:32 +02:00
Merge branch 'bugfix/protocomm_mem_failure' into 'master'
protocomm_console.c: Check if memory is allocated to buf and if not then... See merge request espressif/esp-idf!10733
This commit is contained in:
@@ -139,6 +139,10 @@ static int common_cmd_handler(int argc, char** argv)
|
|||||||
uint32_t cur_session_id = atoi(argv[1]);
|
uint32_t cur_session_id = atoi(argv[1]);
|
||||||
|
|
||||||
uint8_t *buf = (uint8_t *) malloc(strlen(argv[2]));
|
uint8_t *buf = (uint8_t *) malloc(strlen(argv[2]));
|
||||||
|
if (buf == NULL) {
|
||||||
|
ESP_LOGE(TAG, "Failed to allocate memory");
|
||||||
|
return ESP_ERR_NO_MEM;
|
||||||
|
}
|
||||||
uint8_t *outbuf;
|
uint8_t *outbuf;
|
||||||
ssize_t outlen;
|
ssize_t outlen;
|
||||||
ssize_t len = hex2bin(argv[2], buf);
|
ssize_t len = hex2bin(argv[2], buf);
|
||||||
|
Reference in New Issue
Block a user