POP3Aggregator: check whether we already have a session or not before attempting...
[citadel.git] / citadel / modules / pop3client / serv_pop3client.c
index 25c835c7561022bd276c5e8093b879101a1ce8d6..ec744849f8af80e4d6aa4ff34015027349702995 100644 (file)
@@ -199,8 +199,10 @@ void DeletePOP3Aggregator(void *vptr)
        FreeStrBuf(&ptr->IO.SendBuf.Buf);
        FreeStrBuf(&ptr->IO.RecvBuf.Buf);
        DeleteAsyncMsg(&ptr->IO.ReadMsg);
-       ((struct CitContext*)ptr->IO.CitContext)->state = CON_IDLE;
-       ((struct CitContext*)ptr->IO.CitContext)->kill_me = 1;
+       if (((struct CitContext*)ptr->IO.CitContext)) {
+               ((struct CitContext*)ptr->IO.CitContext)->state = CON_IDLE;
+               ((struct CitContext*)ptr->IO.CitContext)->kill_me = 1;
+       }
        FreeAsyncIOContents(&ptr->IO);
        free(ptr);
 }