target/cortex_m: fix clang static analyzer warning
commit9f021c2bc129f8f7c659c64ad19531bd8073264a
authorTomas Vanek <vanekt@fbl.cz>
Thu, 31 Jan 2019 13:21:56 +0000 (31 14:21 +0100)
committerTomas Vanek <vanekt@fbl.cz>
Thu, 7 Feb 2019 08:03:18 +0000 (7 08:03 +0000)
tree174b9cd99d1d5385a1156f10b822d31e985f74b7
parent96903e6df43e2bc967267e034edf15a7c274d044
target/cortex_m: fix clang static analyzer warning

Fix "Potential leak of memory pointed to by 'cortex_m'"
and test for NULL return from calloc in cortex_m_target_create()

Change-Id: I4d2bb5bccc57f0ed60696f3d588297a858b8ea60
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/4881
Tested-by: jenkins
Reviewed-by: Moritz Fischer <moritz.fischer@ettus.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
src/target/cortex_m.c