summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunil Nimmagadda <sunil@nimmagadda.net>2014-05-28 16:37:11 +0500
committerSunil Nimmagadda <sunil@nimmagadda.net>2014-05-28 16:37:11 +0500
commitde616ecae133677d9ab6a0dff1570117e288fa5b (patch)
tree2e45ee73067753dade5d40607f10646882501466
parent3134062a769783557930ff7afd4cfa8a577b423a (diff)
Fix a crash during concurrent sessions TIMEOUT reported by James
Turner (#5). imsgev_close schedules(event_add) iev and the event struct is free-ed before the event is dispatched. Include string.h after recent libressl changes.
-rw-r--r--pop3d.c1
-rw-r--r--session.c2
2 files changed, 1 insertions, 2 deletions
diff --git a/pop3d.c b/pop3d.c
index 02f293b..cbd3ea3 100644
--- a/pop3d.c
+++ b/pop3d.c
@@ -201,7 +201,6 @@ sig_handler(int sig, short event, void *arg)
case SIGHUP:
case SIGTERM:
imsgev_clear(&iev_pop3e);
- imsgev_close(&iev_pop3e);
event_loopexit(NULL);
break;
case SIGCHLD:
diff --git a/session.c b/session.c
index c02174e..eceb800 100644
--- a/session.c
+++ b/session.c
@@ -22,6 +22,7 @@
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <syslog.h>
#include <unistd.h>
@@ -147,7 +148,6 @@ session_close(struct session *s, int flush)
iobuf_clear(&entry->iobuf);
io_clear(&entry->io);
imsgev_clear(&entry->iev_maildrop);
- imsgev_close(&entry->iev_maildrop);
logit(LOG_INFO, "%u: session closed", entry->id);
free(entry);
}