Alloc a new packet if the queue is empty. Fix this.

remotes/origin/master-1.0.x
Victor Julien 17 years ago
parent a454fe4fb7
commit 2f6a186078

@ -28,7 +28,7 @@ Packet *PacketDequeue (PacketQueue *q) {
Packet *p = q->bot;
if (p == NULL) {
/* queue empty, alloc a new packet */
Packet *p = malloc(sizeof(Packet));
p = malloc(sizeof(Packet));
if (p == NULL) {
printf("ERROR: malloc failed: %s\n", strerror(errno));
return NULL;

Loading…
Cancel
Save