commit 3dd255836645db83a93fac941db4693c4e6a4ef4 parent 4fae254e88e7b907cd86aceeefe5bea65f638051 Author: Christophe Coustet <christophe.coustet@meso-star.com> Date: Wed, 20 Nov 2019 16:26:33 +0100 Add missing test of malloc return. Diffstat:
| M | tinyexpr/tinyexpr.c | | | 1 | + |
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/tinyexpr/tinyexpr.c b/tinyexpr/tinyexpr.c @@ -142,6 +142,7 @@ te_expr* te_duplicate(te_expr* n) { te_expr* nn; assert(n); nn = malloc(size); + if (!nn) return NULL; memcpy(nn, n, size); return nn; }