Skip to content

Commit 7a32ea1

Browse files
committed
esp_semihosting: fix null pointer access error
1 parent e47989e commit 7a32ea1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/target/espressif/esp_semihosting.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ static int remove_from_dir_map_list(struct dir_map *dir_map, struct target *targ
136136
static int clean_dir_map_list(struct target *target)
137137
{
138138
struct esp_semihost_data *semihost_data = target_to_esp_semihost_data(target);
139+
140+
if (!semihost_data)
141+
return ERROR_OK;
142+
139143
int ret = list_empty(&semihost_data->dir_map_list);
140144
if (!ret) {
141145
struct dir_map *dir_map;

0 commit comments

Comments
 (0)