Skip to content
Snippets Groups Projects
Commit da0d1e37 authored by Christian Eggers's avatar Christian Eggers Committed by Spencer Oliver
Browse files

gdb_server: fix memory leaks in users of get_reg_features_list()


v4:
- changed first line of commit message
v3:
- added extra LOG_ERROR() message
v2:
- Added missing "goto error"
- free also the on extra element of features[]

In contrast to target_get_gdb_reg_list(), the list returned by
get_reg_features_list() consists of items which are itself
malloc'ed.
--> Free the list items prior freeing the list itself.

Additionally:
- gdb_generate_target_description():
  o Do error handling similar as gdb_get_target_description_chunk() does.
- gdb_get_target_description_chunk()
  o **features must be initialised prior an "goto error" can happen

Change-Id: Iad07824618c51084e0aa0499ee6fc96198b320f0
Signed-off-by: default avatarChristian Eggers <ceggers@gmx.de>
Reviewed-on: http://openocd.zylin.com/1917


Tested-by: jenkins
Reviewed-by: default avatarTrevor Woerner <trevor.woerner@linaro.org>
Reviewed-by: default avatarSpencer Oliver <spen@spen-soft.co.uk>
parent 9b257774
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment