don't fetch & dereference pointers on shut down all the time.
authorWilfried Goesgens <dothebart@citadel.org>
Tue, 13 Jan 2015 22:18:14 +0000 (23:18 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Tue, 13 Jan 2015 22:18:14 +0000 (23:18 +0100)
citadel/modules/pop3/serv_pop3.c

index d49f7deb7b0e9550d66dd61db53cf186882b4462..d3e3e0b50efea70002f649b28b3d4fdea1e0ffb5 100644 (file)
@@ -95,10 +95,13 @@ void pop3_cleanup_function(void)
        /* Don't do this stuff if this is not a POP3 session! */
        if (CCC->h_command_function != pop3_command_loop) return;
 
+       struct citpop3 *pop3 = ((struct citpop3 *)CCC->session_specific_data);
        POP3M_syslog(LOG_DEBUG, "Performing POP3 cleanup hook");
-       if (POP3->msgs != NULL) free(POP3->msgs);
+       if (pop3->msgs != NULL) {
+               free(pop3->msgs);
+       }
 
-       free(POP3);
+       free(pop3);
 }