diff options
author | 2014-07-09 20:34:29 +0000 | |
---|---|---|
committer | 2014-07-09 20:34:29 +0000 | |
commit | 880d7591d7fe46f82daf528be1297ce9408b6340 (patch) | |
tree | 030deb877874127d74d7244fc7f9983110b67998 | |
parent | stale prototype (diff) | |
download | wireguard-openbsd-880d7591d7fe46f82daf528be1297ce9408b6340.tar.xz wireguard-openbsd-880d7591d7fe46f82daf528be1297ce9408b6340.zip |
reset host, port, path to null after freeing so the caller doesn't
accidentally free them again. actually a bug in the caller and (hey hey)
apps/ocsp.c has exactly that bug, but it's easier/safer to fix here.
-rw-r--r-- | lib/libcrypto/ocsp/ocsp_lib.c | 5 | ||||
-rw-r--r-- | lib/libssl/src/crypto/ocsp/ocsp_lib.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/libcrypto/ocsp/ocsp_lib.c b/lib/libcrypto/ocsp/ocsp_lib.c index b55e509586d..d32f0632098 100644 --- a/lib/libcrypto/ocsp/ocsp_lib.c +++ b/lib/libcrypto/ocsp/ocsp_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ocsp_lib.c,v 1.10 2014/06/12 15:49:30 deraadt Exp $ */ +/* $OpenBSD: ocsp_lib.c,v 1.11 2014/07/09 20:34:29 tedu Exp $ */ /* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL * project. */ @@ -265,6 +265,9 @@ err: free(*ppath); free(*pport); free(*phost); + *phost = NULL; + *pport = NULL; + *ppath = NULL; return 0; } diff --git a/lib/libssl/src/crypto/ocsp/ocsp_lib.c b/lib/libssl/src/crypto/ocsp/ocsp_lib.c index b55e509586d..d32f0632098 100644 --- a/lib/libssl/src/crypto/ocsp/ocsp_lib.c +++ b/lib/libssl/src/crypto/ocsp/ocsp_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ocsp_lib.c,v 1.10 2014/06/12 15:49:30 deraadt Exp $ */ +/* $OpenBSD: ocsp_lib.c,v 1.11 2014/07/09 20:34:29 tedu Exp $ */ /* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL * project. */ @@ -265,6 +265,9 @@ err: free(*ppath); free(*pport); free(*phost); + *phost = NULL; + *pport = NULL; + *ppath = NULL; return 0; } |