POP3Aggregator: check whether we already have a session or not before attempting...
[citadel.git] / citadel / modules / pop3client / serv_pop3client.c
index 4fe026efab3bcf691205fedf815e91c90ba48bae..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);
 }
@@ -983,7 +985,7 @@ int pop3_do_fetching(pop3aggr *cpptr)
 /*
  * Scan a room's netconfig to determine whether it requires POP3 aggregation
  */
-void pop3client_scan_room(struct ctdlroom *qrbuf, void *data, const OneRoomNetCfg *OneRNCFG)
+void pop3client_scan_room(struct ctdlroom *qrbuf, void *data, OneRoomNetCfg *OneRNCFG)
 {
        const RoomNetCfgLine *pLine;
        void *vptr;