[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openocd-development
Subject:    [OpenOCD-devel] [PATCH]: 8454ff1 jtag/tcl: remove incorrect Jim_FreeNewObj() call
From:       gerrit () openocd ! org (gerrit)
Date:       2020-06-24 17:22:57
Message-ID: 20200624172257.C85284A0225 () mail ! openocd ! org
[Download RAW message or body]

This is an automated email from Gerrit.

Mikhail Rasputin (mikhail.godlike.rasputin@yandex.ru) just uploaded a new patch set \
to Gerrit, which you can find at http://openocd.zylin.com/5724

-- gerrit

commit 8454ff11236a74ebfb374c2e726805f7ce53a952
Author: Mikhail Rasputin <mikhail.godlike.rasputin@yandex.ru>
Date:   Wed Jun 24 19:21:31 2020 +0300

    jtag/tcl: remove incorrect Jim_FreeNewObj() call
    
    It leads to the double release and breaks the memory heap, because the
    Jim_SetResultFormatted() freed the 'Jim_Obj' earlier.
    
    Change-Id: Ifa5f38009b2d617624b5f27e916720888a3dbad9
    Signed-off-by: Mikhail Rasputin <mikhail.godlike.rasputin@yandex.ru>

diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c
index d2f1f0d..b684821 100644
--- a/src/jtag/tcl.c
+++ b/src/jtag/tcl.c
@@ -690,7 +690,6 @@ static int jim_jtag_arp_init(Jim_Interp *interp, int argc, \
Jim_Obj *const *argv)  if (e != ERROR_OK) {
 		Jim_Obj *eObj = Jim_NewIntObj(goi.interp, e);
 		Jim_SetResultFormatted(goi.interp, "error: %#s", eObj);
-		Jim_FreeNewObj(goi.interp, eObj);
 		return JIM_ERR;
 	}
 	return JIM_OK;
@@ -714,7 +713,6 @@ static int jim_jtag_arp_init_reset(Jim_Interp *interp, int argc, \
Jim_Obj *const  if (e != ERROR_OK) {
 		Jim_Obj *eObj = Jim_NewIntObj(goi.interp, e);
 		Jim_SetResultFormatted(goi.interp, "error: %#s", eObj);
-		Jim_FreeNewObj(goi.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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic