diff --git a/CHANGELOG.md b/CHANGELOG.md index b74e7837..cc63f2d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # v1.9.2-alpha0 * Add direct call for `ti_do_root_chain` _(small performance upgrade)_, pr #453. +* Fixed allocation too much memory for `ti_do_thing`, pr #454. # v1.9.1 diff --git a/inc/ti/version.h b/inc/ti/version.h index bc7c34be..15f28cfe 100644 --- a/inc/ti/version.h +++ b/inc/ti/version.h @@ -25,7 +25,7 @@ * "-rc0" * "" */ -#define TI_VERSION_PRE_RELEASE "-alpha0" +#define TI_VERSION_PRE_RELEASE "-alpha1" #define TI_MAINTAINER \ "Jeroen van der Heijden " diff --git a/src/ti/do.c b/src/ti/do.c index 44fcb00a..2cd1e392 100644 --- a/src/ti/do.c +++ b/src/ti/do.c @@ -2053,7 +2053,10 @@ int ti_do_enum_get(ti_query_t * query, cleri_node_t * nd, ex_t * e) int ti_do_thing(ti_query_t * query, cleri_node_t * nd, ex_t * e) { - return do__thing(query, nd->children->next, e, (uintptr_t) nd->data); + return do__thing(query, + nd->children->next, + e, + (uintptr_t) nd->children->next->data); } int ti_do_array(ti_query_t * query, cleri_node_t * nd, ex_t * e) diff --git a/src/ti/pkg.c b/src/ti/pkg.c index 128e8206..d92a7792 100644 --- a/src/ti/pkg.c +++ b/src/ti/pkg.c @@ -21,8 +21,7 @@ ti_pkg_t * ti_pkg_new(uint16_t id, uint8_t tp, const void * data, uint32_t n) pkg->n = n; pkg->id = id; - if (n) - memcpy(pkg->data, data, n); + memcpy(pkg->data, data, n); return pkg; }