diff --git a/src/space.c b/src/space.c
index 92728887328dfb642b2740ff0718a7a81b6235af..5d032a99fcea1e99d3bd00b9015cd5f70b442517 100644
--- a/src/space.c
+++ b/src/space.c
@@ -484,7 +484,6 @@ void space_rebuild(struct space *s, double cell_max, int verbose) {
 
 void space_parts_sort(struct space *s, int *ind, int N, int min, int max) {
   // Populate a parallel_sort structure with the input data.
-  struct parallel_sort sort;
   space_sort_struct.parts = s->parts;
   space_sort_struct.xparts = s->xparts;
   space_sort_struct.ind = ind;