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
..
2020-07-26 23:09:45 +01:00
2020-07-26 23:09:45 +01:00
2020-07-26 23:09:45 +01:00
2018-01-16 09:05:41 +00:00
2020-02-24 10:28:46 +00:00
2020-01-02 21:24:54 +00:00
2020-02-23 21:36:36 +00:00
2016-05-24 22:30:01 +01:00
2017-02-10 13:50:17 +01:00
2020-07-26 23:09:45 +01:00
2020-02-27 06:46:51 +00:00
2020-07-26 23:09:45 +01:00
2020-02-27 06:46:51 +00:00
2020-07-26 23:09:45 +01:00
2020-02-27 06:46:51 +00:00
2020-07-26 23:09:45 +01:00
2020-07-26 20:08:21 +01:00
2020-07-26 23:09:45 +01:00
2020-07-08 22:07:38 +01:00
2020-07-26 20:12:48 +01:00
2020-07-26 20:12:48 +01:00
2020-07-26 20:12:21 +01:00
2020-07-26 20:12:21 +01:00
2020-08-02 10:48:52 +01:00
2020-08-02 10:48:52 +01:00
2020-08-02 10:48:52 +01:00
2016-05-24 22:30:55 +01:00
2020-07-26 20:12:56 +01:00
2016-05-24 22:30:55 +01:00
2020-07-26 20:12:21 +01:00
2017-02-10 13:50:17 +01:00
2020-07-08 22:07:38 +01:00
2017-02-10 13:50:17 +01:00
2020-07-26 23:09:45 +01:00
2016-05-24 22:30:55 +01:00
2020-07-26 20:12:21 +01:00
2016-05-24 22:30:55 +01:00
2020-07-26 23:09:45 +01:00
2020-01-14 11:40:36 +00:00
2020-05-02 15:40:21 +01:00
2018-04-10 09:13:02 +01:00
2020-01-14 11:40:25 +00:00
2020-07-26 23:09:45 +01:00
2020-05-24 21:26:47 +01:00
2020-07-26 23:09:45 +01:00
2020-07-08 22:08:19 +01:00
2020-07-08 22:07:38 +01:00
2020-07-08 22:07:38 +01:00
2020-07-26 23:09:45 +01:00
2019-03-06 16:16:29 +00:00
2018-06-04 09:16:08 +01:00
2016-05-24 22:30:01 +01:00
2016-05-24 22:30:55 +01:00
2020-06-06 18:05:29 +01:00
2019-05-14 19:37:11 +01:00
2019-05-14 19:35:41 +01:00
2016-05-24 22:30:01 +01:00
2017-02-10 13:50:17 +01:00
2020-06-06 18:05:29 +01:00
2020-03-12 10:11:19 +00:00
2020-07-26 23:09:45 +01:00
2017-02-10 13:50:17 +01:00
2020-07-26 23:09:45 +01:00
2016-05-24 22:30:55 +01:00
2020-04-21 12:55:41 +01:00
2019-06-12 15:14:44 +01:00
2020-07-26 23:09:45 +01:00
2020-07-26 23:09:45 +01:00
2020-06-18 10:11:02 +01:00
2020-07-26 23:09:45 +01:00
2020-05-03 21:42:23 +01:00
2018-04-10 06:16:40 +01:00
2019-05-14 19:37:11 +01:00
2017-02-10 14:01:39 +01:00
2020-07-26 23:09:45 +01:00
2020-07-08 22:08:19 +01:00
2020-03-12 09:47:08 +00:00
2020-03-12 09:47:08 +00:00
2020-07-26 23:09:45 +01:00
2020-07-26 23:09:45 +01:00
2020-05-09 14:39:05 +01:00
2016-05-24 22:30:55 +01:00
2020-05-02 15:40:21 +01:00
2016-05-24 22:30:55 +01:00
2016-05-24 22:30:01 +01:00
2016-05-24 22:30:55 +01:00
2016-05-24 22:30:01 +01:00
2016-05-24 22:30:55 +01:00
2020-07-26 23:09:45 +01:00
2016-05-24 22:30:55 +01:00
2020-03-26 19:30:34 +00:00
2020-03-26 19:30:34 +00:00
2020-07-26 23:09:45 +01:00
2018-11-06 12:17:48 +00:00
2020-07-26 23:09:45 +01:00
2020-05-12 06:05:45 +01:00
2020-05-09 14:40:52 +01:00
2020-02-24 10:30:36 +00:00
2020-07-26 23:09:45 +01:00
2020-07-08 22:08:08 +01:00
2020-07-26 23:09:45 +01:00
2020-02-24 10:30:36 +00:00
2020-07-08 22:07:38 +01:00
2020-07-08 22:07:38 +01:00
2020-03-07 15:30:05 +00:00
2018-12-12 08:47:44 +00:00
2020-07-26 23:09:45 +01:00
2019-05-14 19:37:11 +01:00
2018-12-12 08:47:44 +00:00
2019-05-14 19:37:11 +01:00
2018-12-12 08:47:44 +00:00
2020-03-07 15:30:05 +00:00
2016-05-24 22:30:55 +01:00
2019-05-14 19:37:11 +01:00
2016-05-24 22:30:55 +01:00
2020-06-06 18:06:05 +01:00
2020-07-26 23:09:45 +01:00
2020-07-26 20:12:21 +01:00
2020-07-26 23:09:45 +01:00
2020-01-14 11:37:34 +00:00
2020-07-26 23:09:45 +01:00
2017-02-10 13:50:17 +01:00
2020-07-26 23:09:45 +01:00
2017-02-10 13:50:17 +01:00
2020-03-07 15:30:05 +00:00
2020-04-21 12:55:41 +01:00
2020-06-06 18:05:08 +01:00
2016-05-24 22:30:01 +01:00
2016-05-24 22:30:55 +01:00
2020-07-26 23:09:45 +01:00
2020-07-26 23:09:45 +01:00
2020-07-26 23:09:45 +01:00
2020-07-26 23:09:45 +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
2020-07-26 23:09:45 +01:00
2020-01-20 06:28:49 +00:00
2020-07-26 23:09:45 +01:00
2017-05-08 18:04:56 +01:00
2020-04-21 12:55:41 +01:00
2019-11-28 19:49:10 +00:00
2017-02-10 13:50:17 +01:00
2017-02-10 13:50:17 +01:00
2020-05-09 14:39:44 +01:00
2016-05-24 22:30:55 +01:00
2020-05-09 14:39:29 +01:00
2016-05-24 22:30:55 +01:00
2016-05-24 22:30:55 +01:00
2016-05-24 22:30:55 +01:00
2016-05-24 22:30:01 +01:00
2016-05-24 22:30:55 +01:00
2017-02-10 13:50:17 +01:00
2017-02-10 13:50:17 +01:00
2020-07-26 23:09:45 +01:00
2016-05-24 22:30:55 +01:00
2017-02-10 13:50:17 +01:00
2017-02-10 13:50:17 +01:00
2017-02-10 13:50:17 +01:00
2016-05-24 22:30:55 +01:00
2017-02-10 13:50:17 +01:00
2016-05-24 22:30:55 +01:00
2020-07-08 22:08:08 +01:00
2020-02-15 15:36:56 +00:00
2019-05-14 19:37:11 +01:00
2016-05-24 22:30:55 +01:00
2016-05-24 22:30:01 +01:00
2018-01-13 09:25:12 +00:00
2019-08-28 08:07:37 +01:00
2019-08-28 08:07:37 +01:00
2020-07-26 23:09:45 +01:00
2018-06-04 09:16:08 +01:00
2019-05-14 19:37:11 +01:00
2019-03-27 08:55:03 +00:00
2020-08-02 10:48:41 +01:00
2020-07-26 23:09:45 +01:00
2019-11-07 08:21:40 +00:00
2020-07-26 23:09:45 +01:00
2016-05-24 22:30:55 +01:00
2019-08-28 08:07:37 +01:00
2020-08-08 22:17:43 +01:00
2020-05-24 21:36:43 +01:00
2019-04-07 08:17:36 +01:00
2019-05-14 19:37:11 +01:00
2016-05-24 22:30:55 +01:00
2019-05-14 19:37:11 +01:00
2018-01-13 09:25:34 +00:00
2020-07-26 23:09:45 +01:00
2016-05-24 22:30:55 +01:00