View | Details | Raw Unified | Return to bug 19048 | Differences between
and this patch

Collapse All | Expand All

(-)glibc-2.12-2-gc4ccff1/malloc/arena.c.orig (-2 / +21 lines)
Lines 1148-1155 arena_thread_freeres (void) Link Here
1148
  if (a != NULL)
1148
  if (a != NULL)
1149
    {
1149
    {
1150
      (void)mutex_lock(&list_lock);
1150
      (void)mutex_lock(&list_lock);
1151
      a->next_free = free_list;
1151
      /* Do not make free_list a cyclic one element list.  */
1152
      free_list = a;
1152
      if (a != free_list)
1153
	{
1154
	  if (free_list != NULL)
1155
	    {
1156
	      mstate b = free_list;
1157
	      /* Check if not already in free_list.  */
1158
	      while (b->next_free != NULL)
1159
		{
1160
		  /* "a" can be at most once in free_list.  */
1161
		  if (b->next_free == a)
1162
		    {
1163
		      b->next_free = a->next_free;
1164
		      break;
1165
		    }
1166
		  b = b->next_free;
1167
		}
1168
	    }
1169
	  a->next_free = free_list;
1170
	  free_list = a;
1171
	}
1153
      (void)mutex_unlock(&list_lock);
1172
      (void)mutex_unlock(&list_lock);
1154
    }
1173
    }
1155
}
1174
}

Return to bug 19048