Handler target_get_gdb_reg_list() better.

That function might change from NULL reg_list but then return failure.
In that case reg_list shouldn't be freed.

Change-Id: I5380630c871d056fb52e25bda16836e346bd74b2
This commit is contained in:
Tim Newsome 2019-01-07 12:15:18 -08:00
parent 4bb8bd005c
commit f9af0b6cca
1 changed files with 1 additions and 0 deletions

View File

@ -2399,6 +2399,7 @@ static int gdb_target_description_supported(struct target *target, int *supporte
&reg_list_size, REG_CLASS_ALL);
if (retval != ERROR_OK) {
LOG_ERROR("get register list failed");
reg_list = NULL;
goto error;
}