]> git.sur5r.net Git - openocd/commitdiff
jtag/tcl: Fix double free in jtag newtap argument parsing
authorAndreas Fritiofson <andreas.fritiofson@gmail.com>
Sat, 28 Sep 2013 14:07:14 +0000 (16:07 +0200)
committerSpencer Oliver <spen@spen-soft.co.uk>
Mon, 7 Oct 2013 19:03:02 +0000 (19:03 +0000)
Found when grepping for void* casts. I'm pretty sure there are about
*picking a number out of the blue* 0.31 bugs per pointer cast in OpenOCD.

Verified by valgrind, i.e.:
valgrind openocd -f interface/jtagkey.cfg -c "jtag newtap dummy cpu -irlen foo"

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

index d0020cd37e18c267f30c7df47900270f27a5e17f..227222ef4002f0f3e84c5a40e53672fd042aa835 100644 (file)
@@ -467,7 +467,6 @@ static int jim_newtap_ir_param(Jim_Nvp *n, Jim_GetOptInfo *goi,
        if (e != JIM_OK) {
                Jim_SetResultFormatted(goi->interp,
                        "option: %s bad parameter", n->name);
-               free((void *)pTap->dotted_name);
                return e;
        }
        switch (n->value) {