From 3fb65f5ec206b8561fcc44457fd283f33e2f3f62 Mon Sep 17 00:00:00 2001 From: Anoop Saldanha Date: Thu, 8 Sep 2011 16:25:00 +0530 Subject: [PATCH] fix local var usage for slot in tm-threads.c --- src/tm-threads.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/tm-threads.c b/src/tm-threads.c index 8b2a1469c0..ced89b1194 100644 --- a/src/tm-threads.c +++ b/src/tm-threads.c @@ -666,14 +666,15 @@ void *TmThreadsSlotVar(void *td) tv->tmqh_out(tv, p); /* now handle the post_pq packets */ - for (s = slot; s != NULL; s = s->slot_next) { - while (s->slot_post_pq.top != NULL) { - Packet *extra_p = PacketDequeue(&s->slot_post_pq); + TmSlot *slot; + for (slot = s; slot != NULL; slot = slot->slot_next) { + while (slot->slot_post_pq.top != NULL) { + Packet *extra_p = PacketDequeue(&slot->slot_post_pq); if (extra_p == NULL) break; - if (s->slot_next != NULL) { - r = TmThreadsSlotVarRun(tv, extra_p, s->slot_next); + if (slot->slot_next != NULL) { + r = TmThreadsSlotVarRun(tv, extra_p, slot->slot_next); if (r == TM_ECODE_FAILED) { TmqhOutputPacketpool(tv, extra_p); TmThreadsSetFlag(tv, THV_FAILED); @@ -682,8 +683,8 @@ void *TmThreadsSlotVar(void *td) } /* output the packet */ tv->tmqh_out(tv, extra_p); - } /* while (s->slot_post_pq.top != NULL) */ - } /* for (s = slot; s != NULL; s = s->slot_next) */ + } /* while (slot->slot_post_pq.top != NULL) */ + } /* for (slot = s; slot != NULL; slot = slot->slot_next) */ } /* if (p != NULL) */ if (TmThreadsCheckFlag(tv, THV_KILL)) {