commit - 34f87d66a849d11bdcfa5326ddfcb354d05d077d
commit + adebfe7ca6a3738adf2246bcc87552914348c30a
blob - bafe39fddfcb8ac9a38af4e2ef813d393ea34044
blob + 2ed1f71cc3fc3fc56c6cbd83739a26eaa6cbcdd2
--- opensmtpd.c
+++ opensmtpd.c
{
size_t i = 0;
int registered = 0;
- /* Doesn't leak, since it needs to exists until the application ends. */
+ struct event_base *evbase;
struct io *io_stdin;
struct osmtpd_callback *hidenity = NULL, *eidentity = NULL;
struct osmtpd_callback *ridentity = NULL;
- event_init();
+ evbase = event_init();
if ((io_stdin = io_new()) == NULL ||
(io_stdout = io_new()) == NULL)
ready = 1;
event_dispatch();
+ io_free(io_stdin);
+ io_free(io_stdout);
+ event_base_free(evbase);
}
__dead void
char *end;
size_t i;
- if (ev == IO_DISCONNECTED)
- exit(0);
+ if (ev == IO_DISCONNECTED) {
+ event_loopexit(0);
+ return;
+ }
if (ev != IO_DATAIN)
return;
while ((line = io_getline(io, &linelen)) != NULL) {