e = aice_init_reset(context);
if (e != ERROR_OK) {
- Jim_Obj *eObj = Jim_NewIntObj(goi.interp, e);
- Jim_SetResultFormatted(goi.interp, "error: %#s", eObj);
- Jim_FreeNewObj(goi.interp, eObj);
+ Jim_Obj *obj = Jim_NewIntObj(goi.interp, e);
+ Jim_SetResultFormatted(goi.interp, "error: %#s", obj);
return JIM_ERR;
}
return JIM_OK;
struct command_context *context = current_command_context(interp);
int e = jtag_init_inner(context);
if (e != ERROR_OK) {
- Jim_Obj *eObj = Jim_NewIntObj(goi.interp, e);
- Jim_IncrRefCount(eObj);
- Jim_SetResultFormatted(goi.interp, "error: %#s", eObj);
- Jim_DecrRefCount(goi.interp, eObj);
+ Jim_Obj *obj = Jim_NewIntObj(goi.interp, e);
+ Jim_SetResultFormatted(goi.interp, "error: %#s", obj);
return JIM_ERR;
}
return JIM_OK;
e = swd_init_reset(context);
if (e != ERROR_OK) {
- Jim_Obj *eObj = Jim_NewIntObj(goi.interp, e);
- Jim_IncrRefCount(eObj);
- Jim_SetResultFormatted(goi.interp, "error: %#s", eObj);
- Jim_DecrRefCount(goi.interp, eObj);
+ Jim_Obj *obj = Jim_NewIntObj(goi.interp, e);
+ Jim_SetResultFormatted(goi.interp, "error: %#s", obj);
return JIM_ERR;
}
return JIM_OK;