gdb_server: fix memory leaks in users of get_reg_features_list() 17/1917/6
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

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)