Changeset 52 for trunk/lib


Ignore:
Timestamp:
08/08/05 20:43:07 (19 years ago)
Author:
tim
Message:

fixed a double-free bug which FreeBSD (but not Linux) catches and bails on.

other minor tweaks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/void_stack.c

    r38 r52  
    9090void void_stack_destroy(void_stack* stack)
    9191{
     92  free(stack->elements);
    9293  free(stack);
    9394}
     
    99100  for(i=0; i < stack->top; i++)
    100101    free(stack->elements[i]);
     102  free(stack->elements);
    101103  free(stack);
    102104}
     
    127129  if(stack->top > 0)
    128130  {
    129     ret_val = stack->elements[--stack->top];
     131    ret_val = stack->elements[--(stack->top)];
    130132    stack->elements[stack->top] = NULL;
    131133  }
Note: See TracChangeset for help on using the changeset viewer.