diff --git a/libyasm/expr.c b/libyasm/expr.c index c2c868ed..2987def7 100644 --- a/libyasm/expr.c +++ b/libyasm/expr.c @@ -994,7 +994,10 @@ yasm_expr__copy_except(const yasm_expr *e, int except) { yasm_expr *n; int i; - + + if (e == NULL) + return NULL; + n = yasm_xmalloc(sizeof(yasm_expr) + sizeof(yasm_expr__item)*(e->numterms<2?0:e->numterms-2));