summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Varshavchik2021-02-20 20:57:03 -0500
committerSam Varshavchik2021-02-20 20:57:50 -0500
commit4f8680c108d2ca32611dd60345cb0553a2ebd82e (patch)
tree949871a09c098ae6fe230dee1cd57b076554665f
parentd95066af14e9d4a8260a54fd47c3294c57130a7b (diff)
downloadcourier-libs-4f8680c108d2ca32611dd60345cb0553a2ebd82e.tar.bz2
Fix access(NULL) call, and a memory leak.
Seems to be harmless. The memory leak is in a standalong couriertls process, which is mostly a nothing-burger.
-rw-r--r--tcpd/libcouriertls.c3
-rw-r--r--tcpd/starttls.c1
2 files changed, 4 insertions, 0 deletions
diff --git a/tcpd/libcouriertls.c b/tcpd/libcouriertls.c
index 5105030..874a0d1 100644
--- a/tcpd/libcouriertls.c
+++ b/tcpd/libcouriertls.c
@@ -445,6 +445,9 @@ static void load_dh_params(SSL_CTX *ctx, const char *filename,
static int check_readable_file(const char *filename)
{
+ if (!filename)
+ return 0;
+
return (access(filename, R_OK) == 0) ? 1 : 0;
}
diff --git a/tcpd/starttls.c b/tcpd/starttls.c
index e7b805f..76fcf3b 100644
--- a/tcpd/starttls.c
+++ b/tcpd/starttls.c
@@ -550,6 +550,7 @@ static int dossl(int fd, int argn, int argc, char **argv)
if (!ssl)
{
close(fd);
+ tls_destroy(ctx);
return (1);
}