jtag/tcl: Avoid casting away const 67/1667/2
authorAndreas Fritiofson <andreas.fritiofson@gmail.com>
Sat, 28 Sep 2013 14:31:06 +0000 (16:31 +0200)
committerSpencer Oliver <spen@spen-soft.co.uk>
Mon, 7 Oct 2013 19:03:30 +0000 (19:03 +0000)
Here, in_value == out_value, so free the non-const one.

Change-Id: I017ad9e7519711ac0c9da79265be7daaa846f356
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1667
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
src/jtag/tcl.c

index fb060f9..b95bf75 100644 (file)
@@ -205,7 +205,7 @@ static int Jim_Command_drscan(Jim_Interp *interp, int argc, Jim_Obj *const *args
 
                Jim_GetLong(interp, args[i], &bits);
                str = buf_to_str(fields[field_count].in_value, bits, 16);
-               free((void *)fields[field_count].out_value);
+               free(fields[field_count].in_value);
 
                Jim_ListAppendElement(interp, list, Jim_NewStringObj(interp, str, strlen(str)));
                free(str);