From 860b8ff1992af75885515a2dd9ea4824f29c7ae0 Mon Sep 17 00:00:00 2001 From: Lewis Van Winkle Date: Thu, 2 Jun 2016 12:09:58 -0500 Subject: [PATCH] Bug fix on some bad expressions. --- tinyexpr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tinyexpr.c b/tinyexpr.c index 42bee22..129a8fc 100644 --- a/tinyexpr.c +++ b/tinyexpr.c @@ -68,6 +68,7 @@ static te_expr *new_expr(const int type, const te_expr *parameters[]) { const int psize = sizeof(void*) * arity; const int size = sizeof(te_expr) + psize + (IS_CLOSURE(type) ? sizeof(void*) : 0); te_expr *ret = malloc(size); + memset(ret, 0, size); if (arity && parameters) { memcpy(ret->parameters, parameters, psize); }