]> git.sur5r.net Git - openocd/commit
gdb_server: fix memory leaks in users of get_reg_features_list()
authorChristian Eggers <ceggers@gmx.de>
Sun, 2 Feb 2014 12:25:16 +0000 (13:25 +0100)
committerSpencer Oliver <spen@spen-soft.co.uk>
Tue, 4 Mar 2014 20:17:53 +0000 (20:17 +0000)
commitda0d1e374bdf7eabf27c0e31dec57532e4d7e4c8
treedec34d20b68a7c92b5731d4fb77229ed619c6607
parent9b2577742cc49683ab0ea8506d93e3e285b53bbd
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: Christian Eggers <ceggers@gmx.de>
Reviewed-on: http://openocd.zylin.com/1917
Tested-by: jenkins
Reviewed-by: Trevor Woerner <trevor.woerner@linaro.org>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
src/server/gdb_server.c