This is an automated email from Gerrit.

Antonio Borneo (borneo.anto...@gmail.com) just uploaded a new patch set to 
Gerrit, which you can find at http://openocd.zylin.com/5453

-- gerrit

commit b4c5dda2ab0a6d94ebb86584a18c63ba6c1893e9
Author: Antonio Borneo <borneo.anto...@gmail.com>
Date:   Fri Feb 14 14:35:51 2020 +0100

    target: fix crash with jimtcl 0.78
    
    The jimtcl commit 41c5ff1809f5 ("jim.c: Fix Object leak in zlib
    support") https://repo.or.cz/jimtcl.git/commit/41c5ff1809f5
    makes Jim_SetResultFormatted() freeing the parameters that have
    zero refcount.
    
    OpenOCD commit 559d08c19ed8 ("jim tests: use installed") adds the
    only code instance in OpenOCD that first passes a zero refcount
    object to Jim_SetResultFormatted() and then frees it.
    By switching jimtcl version to 0.78 or newer this causes a crash
    of OpenOCD.
    To trigger the crash in a telnet session, check that the current
    target is running and type:
        [target current] arp_waitstate halted 1
    
    Remove the call to Jim_FreeNewObj() after the call to
    Jim_SetResultFormatted().
    
    Change-Id: I5f5a8bca96a0e8466ff7b789fe578ea9785fa550
    Signed-off-by: Antonio Borneo <borneo.anto...@gmail.com>

diff --git a/src/target/target.c b/src/target/target.c
index 936a5da..b750a1b 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -5157,7 +5157,6 @@ static int jim_target_wait_state(Jim_Interp *interp, int 
argc, Jim_Obj *const *a
                                "target: %s wait %s fails (%#s) %s",
                                target_name(target), n->name,
                                eObj, target_strerror_safe(e));
-               Jim_FreeNewObj(interp, eObj);
                return JIM_ERR;
        }
        return JIM_OK;

-- 


_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to