about summary refs log tree commit diff
path: root/src/rt/rust_upcall.cpp
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2012-01-07 08:03:34 -0800
committerNiko Matsakis <niko@alum.mit.edu>2012-01-07 08:03:34 -0800
commit5bee80612b6e6dc3d0ccf78df22e58439daae8c1 (patch)
treeef0d6ad1aa1411ac8091be02407773807ffe6f89 /src/rt/rust_upcall.cpp
parent1e674ffe430d1c442a31b21988c9c72bd38128bd (diff)
downloadrust-5bee80612b6e6dc3d0ccf78df22e58439daae8c1.tar.gz
rust-5bee80612b6e6dc3d0ccf78df22e58439daae8c1.zip
fix valgrind error: allocate enough space for all type descs
Diffstat (limited to 'src/rt/rust_upcall.cpp')
-rw-r--r--src/rt/rust_upcall.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp
index 2b104548f90..423287e017e 100644
--- a/src/rt/rust_upcall.cpp
+++ b/src/rt/rust_upcall.cpp
@@ -247,7 +247,7 @@ void upcall_s_create_shared_type_desc(s_create_shared_type_desc_args *args)
     // Copy the main part of the type descriptor:
     const type_desc *td = args->td;
     int n_params = td->n_params;
-    size_t sz = sizeof(type_desc) + sizeof(type_desc*) * n_params;
+    size_t sz = sizeof(type_desc) + sizeof(type_desc*) * (n_params+1);
     args->res = (type_desc*) task->kernel->malloc(sz, "create_shared_type_desc");
     memcpy(args->res, td, sizeof(type_desc));