From: Andreas Fritiofson Date: Sat, 28 Sep 2013 14:31:06 +0000 (+0200) Subject: jtag/tcl: Avoid casting away const X-Git-Tag: v0.8.0-rc1~229 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=85830c32bfa3159cf05ba7619bf32c1c43db7f2e;p=openocd jtag/tcl: Avoid casting away const Here, in_value == out_value, so free the non-const one. Change-Id: I017ad9e7519711ac0c9da79265be7daaa846f356 Signed-off-by: Andreas Fritiofson Reviewed-on: http://openocd.zylin.com/1667 Tested-by: jenkins Reviewed-by: Spencer Oliver --- diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c index fb060f9a..b95bf756 100644 --- a/src/jtag/tcl.c +++ b/src/jtag/tcl.c @@ -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);