summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreric <eric@openbsd.org>2014-02-17 19:50:09 +0000
committereric <eric@openbsd.org>2014-02-17 19:50:09 +0000
commit67aa17dc9674a817e5172df4ea5ef4dd26564d04 (patch)
tree6f84ebfc09542f9034c1f45a7962a68afece46d1
parentiha and trm are good targets to avoid a space crisis on the install media; (diff)
downloadwireguard-openbsd-67aa17dc9674a817e5172df4ea5ef4dd26564d04.tar.xz
wireguard-openbsd-67aa17dc9674a817e5172df4ea5ef4dd26564d04.zip
fix possible NULL-deref in error code path
-rw-r--r--usr.sbin/smtpd/ssl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/ssl.c b/usr.sbin/smtpd/ssl.c
index bdccfe1785e..9c188ccdd4e 100644
--- a/usr.sbin/smtpd/ssl.c
+++ b/usr.sbin/smtpd/ssl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl.c,v 1.59 2014/02/04 13:44:41 eric Exp $ */
+/* $OpenBSD: ssl.c,v 1.60 2014/02/17 19:50:09 eric Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -245,7 +245,8 @@ fail:
free(buf);
if (bio != NULL)
BIO_free_all(bio);
- fclose(fp);
+ if (fp)
+ fclose(fp);
return (NULL);
}