diff --git a/thread.c b/thread.c index 3ce46a3..b84ed73 100644 --- a/thread.c +++ b/thread.c @@ -1,3 +1,7 @@ +/* + * $Id$ + */ + #include #include "tuvebot.h" @@ -13,6 +17,7 @@ tid = (int)threadid; writeLog(0,"Starting Bot's CMD Thread: [%d]\n", tid); + while (1) { if (connected == 0) { sleep(5); @@ -111,10 +116,12 @@ sprintf(qryStr,"UPDATE channels SET updated = 0 WHERE channel = '%s'",row[0]); dbQuery(qryStr,0); - } - mysql_free_result(res); + } } - + + if (res != 0x0) + mysql_free_result(res); + if (lC == 6) { lC = 0; sWriteSocket("STATUS");