aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libexpr/eval.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 517a1151e..cb7c22e29 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -348,7 +348,7 @@ void EvalState::mkList(Value & v, unsigned int length)
{
v.type = tList;
v.list.length = length;
- v.list.elems = (Value * *) GC_MALLOC(length * sizeof(Value *));
+ v.list.elems = length ? (Value * *) GC_MALLOC(length * sizeof(Value *)) : 0;
nrListElems += length;
}