 +  if (sem->hhead != NULL)
      {
        serr("ERROR: Semaphore destroyed with holders\n");
-+      DEBUGASSERT(sem->hhead != NULL);
++      DEBUGASSERT(sem->hhead == NULL);
        (void)sem_foreachholder(sem, sem_recoverholders, NULL);
      }
  #else
 -  if (sem->holder.htcb)
-+  if (sem->holder[0].htcb != NULL || sem->holder[0].htcb != NULL)
-     {
-+      DEBUGASSERT(sem->holder[0].htcb != NULL || sem->holder[0].htcb != NULL);
++  if (sem->holder[0].htcb != NULL || sem->holder[1].htcb != NULL)
+     {
++      DEBUGASSERT(sem->holder[0].htcb == NULL || sem->holder[1].htcb == NULL);
        serr("ERROR: Semaphore destroyed with holder\n");
      }
  

+  int i;
+  pholder = NULL;
+
+  /* We have two hard-allocated holder structuse in sem_t */
+
+  for (i = 0; i < 2; i++)
     {

 #endif
       return OK;
diff --git NuttX/nuttx/sched/semaphore/sem_holder.c NuttX/nuttx/sched/semaphore/sem_holder.c
index 6b9f05a..7b4e3e3 100644
--- NuttX/nuttx/sched/semaphore/sem_holder.c
+++ NuttX/nuttx/sched/semaphore/sem_holder.c
@@ -93,7 +93,7 @@ static inline FAR struct semholder_s *sem_allocholder(sem_t *sem)
