Hi all

For the following code I keep getting an access violation exception but i'am not sure why. the expection seems to disappear when the size of the queue is one. queue being a single linked list:

{
b=H_queue_empty_H;
H_queue_empty_H=H_queue_empty_H->next; // THE EXCECPION APPEARS HERE
b->start=currentTime;
b->duration= currentTime +GenExpRV(mewHwait_H);
if(H_queue_tail_H!=(queue *)NULL)
{
H_queue_tail_H->next=b;
b->prev=H_queue_tail_H;
b->next = (queue *)NULL;
H_queue_tail_H=b;
}


So guys what do you think might be the problem?

Any suggestions plz