Files
sw_openocd/src/target
Antonio Borneo cd06642314 target: fix memory leaks on target_create() fail
There are failure cases of target_create() that are not checked.
Plus, in case of failure the memory allocated in not properly
released before returning error.

Check all the possible failure in target_create().
Change current_target only when target is successfully created.
Add the new target to all_targets list only when target is
successfully created.
Release all the allocated memory before quit on failure.
Use malloc() instead of calloc() for target->type, because the
struct will be fully populated with memcpy().

Change-Id: Ib6f91cbb50c28878e7c73dc070b17b8d7d4e902f
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5776
Tested-by: jenkins
2020-08-08 22:17:43 +01:00
..
2018-01-16 09:05:41 +00:00
2016-05-24 22:30:55 +01:00
2020-07-08 22:07:38 +01:00
2020-01-14 11:40:36 +00:00
2018-04-10 09:13:02 +01:00
2020-07-08 22:07:38 +01:00
2020-07-08 22:07:38 +01:00
2020-03-12 10:11:19 +00:00
2020-04-21 12:55:41 +01:00
2016-05-24 22:30:55 +01:00
2020-07-08 22:08:08 +01:00
2018-12-12 08:47:44 +00:00
2018-12-12 08:47:44 +00:00
2018-12-12 08:47:44 +00:00
2016-05-24 22:30:55 +01:00
2020-01-14 11:37:34 +00:00
2020-04-21 12:55:41 +01:00
2020-06-06 18:05:08 +01:00
2020-04-21 12:55:41 +01:00
2019-11-28 16:59:15 +00:00
2020-07-08 22:08:08 +01:00
2019-11-28 16:59:15 +00:00
2017-05-08 18:04:56 +01:00
2020-04-21 12:55:41 +01:00
2020-07-08 22:08:08 +01:00
2020-02-15 15:36:56 +00:00
2020-05-24 21:36:43 +01:00
2016-05-24 22:30:55 +01:00
2016-05-24 22:30:55 +01:00