Read co->client only when co is locked
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 23 Apr 2010 13:33:31 +0000 (15:33 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 23 Apr 2010 13:33:31 +0000 (15:33 +0200)
src/connection.c

index f1c19ec..4ca648e 100644 (file)
@@ -239,10 +239,11 @@ void connection_continue(struct connection *co)
 static void connection_handler(IOCHAN iochan, int event)
 {
     struct connection *co = iochan_getdata(iochan);
-    struct client *cl = co->client;
+    struct client *cl;
     struct host *host = co->host;
 
     yaz_mutex_enter(host->mutex);
+    cl = co->client;
     if (!cl) 
     {
         /* no client associated with it.. We are probably getting