helper/command: fix clang static analyzer warning
authorTomas Vanek <vanekt@fbl.cz>
Thu, 29 Oct 2020 17:32:13 +0000 (18:32 +0100)
committerAntonio Borneo <borneo.antonio@gmail.com>
Wed, 4 Nov 2020 17:35:14 +0000 (17:35 +0000)
commita932810f9d55256caea8c65a79506e838a17c316
treec603ba534819d3779fa0bbdf95db33b1b3c43dca
parentcd19f466885d542cfee16d5341369b3c445a696f
helper/command: fix clang static analyzer warning

Warning: line 955, column 3
Argument to free() is the address of a global variable, which
is not memory allocated by malloc()

It is definitely a false alarm. Simplify concatenation of arguments
and allocate a string always to silence the warning.

Change-Id: I5ac4cc610fc35224df0b16ef4f7102700363249f
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/5904
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
src/helper/command.c