ModSim: Fixed memory leak.

parent 5ca18390
...@@ -39,8 +39,9 @@ void rabbit_die(rabbit **ptr) { ...@@ -39,8 +39,9 @@ void rabbit_die(rabbit **ptr) {
if( r == rabbits ) if( r == rabbits )
rabbits = r->next; rabbits = r->next;
else
*ptr = NULL;
*ptr = NULL;
rabbit_count--; rabbit_count--;
free(r); free(r);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment