X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fcitserver.c;h=8b3cdaa50a2815255590c4d1a5dc94bedfcb3bf5;hb=acfea2084c5b599e967ecbfdddd88e762b3b3179;hp=ead5ddc5628709b7dbf43150f580f99cd07118d4;hpb=e5bb8bde105c5b5df9479d3f296a9fefaeb61750;p=citadel.git diff --git a/citadel/citserver.c b/citadel/citserver.c index ead5ddc56..8b3cdaa50 100644 --- a/citadel/citserver.c +++ b/citadel/citserver.c @@ -58,6 +58,9 @@ void master_cleanup() { /* * Gracefully terminate the session and thread. * (This is called as a cleanup handler by the thread library.) + * + * All NON-system-dependent stuff is done in this function. + * System-dependent session/thread cleanup is in cleanup() in sysdep.c */ void cleanup_stuff() { @@ -83,6 +86,9 @@ void cleanup_stuff() } end_critical_section(S_SESSION_TABLE); + /* Deallocate any message list we might have in memory */ + if (CC->msglist != NULL) free(CC->msglist); + /* Now get rid of the session and context */ lprintf(7, "cleanup_stuff() is calling RemoveContext(%d)\n", CC->cs_pid); RemoveContext(CC); @@ -608,6 +614,8 @@ void *context_loop(struct CitContext *con) CC->upload_fp = NULL; CC->cs_pid = con->client_socket; /* not necessarily portable */ CC->FirstExpressMessage = NULL; + CC->msglist = NULL; + CC->num_msgs = 0; time(&CC->lastcmd); time(&CC->lastidle); strcpy(CC->lastcmdname, " ");