diff --git a/src/cell.c b/src/cell.c
index 775df65df55cd5ccace8317971088d8330ef30db..25ee6a747c91c37ed41de7e38b5696864513e83c 100644
--- a/src/cell.c
+++ b/src/cell.c
@@ -4283,34 +4283,23 @@ void cell_drift_multipole(struct cell *c, const struct engine *e) {
  * hierarchy.
  *
  * @param c The #cell to clean.
- * @param is_super Is this a super-cell?
  */
-void cell_clear_stars_sort_flags(struct cell *c, const int is_super) {
+void cell_clear_stars_sort_flags(struct cell *c) {
 
   /* Recurse if possible */
   if (c->split) {
     for (int k = 0; k < 8; k++)
-      if (c->progeny[k] != NULL)
-        cell_clear_stars_sort_flags(c->progeny[k], /*is_super=*/0);
-  }
-
-  /* Free the sorted array at the level where it was allocated */
-  if (is_super) {
-
-#ifdef SWIFT_DEBUG_CHECKS
-    if (c != c->hydro.super) error("Cell is not a super-cell!!!");
-#endif
-
-    for (int i = 0; i < 13; i++) {
-      free(c->stars.sort[i]);
-    }
+      if (c->progeny[k] != NULL) cell_clear_stars_sort_flags(c->progeny[k]);
   }
 
   /* Indicate that the cell is not sorted and cancel the pointer sorting arrays.
    */
   c->stars.sorted = 0;
   for (int i = 0; i < 13; i++) {
-    c->stars.sort[i] = NULL;
+    if (c->stars.sort[i] != NULL) {
+      free(c->stars.sort[i]);
+      c->stars.sort[i] = NULL;
+    }
   }
 }
 
diff --git a/src/cell.h b/src/cell.h
index a378fa971f2ca6da18bba40ffc5e160bef941aa8..ecb12e2607e48b38f91c7226ffdba4e0c9efcb9b 100644
--- a/src/cell.h
+++ b/src/cell.h
@@ -779,7 +779,7 @@ void cell_clear_limiter_flags(struct cell *c, void *data);
 void cell_set_super_mapper(void *map_data, int num_elements, void *extra_data);
 void cell_check_spart_pos(const struct cell *c,
                           const struct spart *global_sparts);
-void cell_clear_stars_sort_flags(struct cell *c, const int is_super);
+void cell_clear_stars_sort_flags(struct cell *c);
 int cell_has_tasks(struct cell *c);
 void cell_remove_part(const struct engine *e, struct cell *c, struct part *p,
                       struct xpart *xp);
diff --git a/src/runner.c b/src/runner.c
index 06dced09ae9390419a988a1cf9351e77bf47a82d..50cbad59b0b5bcae6611e71635e971ef6c761adf 100644
--- a/src/runner.c
+++ b/src/runner.c
@@ -660,7 +660,8 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
    * re-compute them. */
   if (with_feedback && (c == c->hydro.super) &&
       (current_stars_count != c->stars.count)) {
-    cell_clear_stars_sort_flags(c, /*is_super=*/1);
+
+    cell_clear_stars_sort_flags(c);
     runner_do_stars_sort(r, c, 0x1FFF, /*cleanup=*/0, /*timer=*/0);
   }