diff -urN tpop3d-1.5.1/auth_perl.c tpop3d-1.5.1.new/auth_perl.c --- tpop3d-1.5.1/auth_perl.c Thu Jan 9 17:59:37 2003 +++ tpop3d-1.5.1.new/auth_perl.c Wed Aug 27 13:32:33 2003 @@ -98,7 +98,7 @@ } /* Put a useful string into the environment. */ - putenv(xstrdup("TPOP3D_CONTEXT=auth_perl")); + setenv("TPOP3D_CONTEXT","auth_perl",1); /* Create and start up perl interpreter. */ perl_interp = perl_alloc(); diff -urN tpop3d-1.5.1/connection.c tpop3d-1.5.1.new/connection.c --- tpop3d-1.5.1/connection.c Mon Jul 14 19:31:20 2003 +++ tpop3d-1.5.1.new/connection.c Wed Aug 27 13:32:39 2003 @@ -319,6 +319,8 @@ pc = pop3command_new(p); + xfree(line); + return pc; } diff -urN tpop3d-1.5.1/listener.c tpop3d-1.5.1.new/listener.c --- tpop3d-1.5.1/listener.c Thu Jan 9 17:59:37 2003 +++ tpop3d-1.5.1.new/listener.c Wed Aug 27 13:33:43 2003 @@ -182,6 +182,11 @@ regfree(&L->re); xfree(L->regex); #endif +#ifdef USE_TLS + if (L->tls.ctx) { + tls_close(L->tls.ctx); + } +#endif xfree(L); } diff -urN tpop3d-1.5.1/maildir.c tpop3d-1.5.1.new/maildir.c --- tpop3d-1.5.1/maildir.c Mon Jul 14 19:31:20 2003 +++ tpop3d-1.5.1.new/maildir.c Wed Aug 27 13:32:47 2003 @@ -113,6 +113,7 @@ lockdirname = xmalloc(strlen(dirname) + sizeof("/.poplock")); sprintf(lockdirname, "%s/.poplock", dirname); rmdir(lockdirname); /* Nothing we can do if this fails. */ + xfree(lockdirname); } diff -urN tpop3d-1.5.1/main.c tpop3d-1.5.1.new/main.c --- tpop3d-1.5.1/main.c Mon Jul 14 19:31:20 2003 +++ tpop3d-1.5.1.new/main.c Wed Aug 27 13:33:48 2003 @@ -310,6 +311,7 @@ skip: xfree(host); xfree(port); + xfree(domain); #ifdef USE_TLS xfree(cert); xfree(pkey); diff -urN tpop3d-1.5.1/tls.c tpop3d-1.5.1.new/tls.c --- tpop3d-1.5.1/tls.c Thu Jan 9 17:59:39 2003 +++ tpop3d-1.5.1.new/tls.c Wed Aug 27 13:32:53 2003 @@ -113,8 +113,8 @@ /* tls_close: * Shut down TLS stuff. */ -void tls_close(void) { - +void tls_close(SSL_CTX *ctx) { + SSL_CTX_free(ctx); } #endif /* USE_TLS */ diff -urN tpop3d-1.5.1/tls.h tpop3d-1.5.1.new/tls.h --- tpop3d-1.5.1/tls.h Thu Jan 9 17:59:39 2003 +++ tpop3d-1.5.1.new/tls.h Wed Aug 27 10:29:29 2003 @@ -15,6 +15,6 @@ /* tls.c */ int tls_init(void); SSL_CTX *tls_create_context(const char *certfile, const char *pkeyfile); -void tls_close(void); +void tls_close(SSL_CTX *ctx); #endif /* __TLS_H_ */