diff options
author | tedu <> | 2014-07-09 20:34:29 +0000 |
---|---|---|
committer | tedu <> | 2014-07-09 20:34:29 +0000 |
commit | 712443529fe06079170bae8abaae1eb825169162 (patch) | |
tree | f6603d3b882b0dd522c90f24b9d29f827b4d28fd /src | |
parent | 65ce8f9ac6c1c473179c5e1e50b6e5df06a5bacc (diff) | |
download | openbsd-712443529fe06079170bae8abaae1eb825169162.tar.gz openbsd-712443529fe06079170bae8abaae1eb825169162.tar.bz2 openbsd-712443529fe06079170bae8abaae1eb825169162.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.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/ocsp/ocsp_lib.c | 5 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/ocsp/ocsp_lib.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/libcrypto/ocsp/ocsp_lib.c b/src/lib/libcrypto/ocsp/ocsp_lib.c index b55e509586..d32f063209 100644 --- a/src/lib/libcrypto/ocsp/ocsp_lib.c +++ b/src/lib/libcrypto/ocsp/ocsp_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ocsp_lib.c,v 1.10 2014/06/12 15:49:30 deraadt Exp $ */ | 1 | /* $OpenBSD: ocsp_lib.c,v 1.11 2014/07/09 20:34:29 tedu Exp $ */ |
2 | /* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL | 2 | /* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL |
3 | * project. */ | 3 | * project. */ |
4 | 4 | ||
@@ -265,6 +265,9 @@ err: | |||
265 | free(*ppath); | 265 | free(*ppath); |
266 | free(*pport); | 266 | free(*pport); |
267 | free(*phost); | 267 | free(*phost); |
268 | *phost = NULL; | ||
269 | *pport = NULL; | ||
270 | *ppath = NULL; | ||
268 | return 0; | 271 | return 0; |
269 | } | 272 | } |
270 | 273 | ||
diff --git a/src/lib/libssl/src/crypto/ocsp/ocsp_lib.c b/src/lib/libssl/src/crypto/ocsp/ocsp_lib.c index b55e509586..d32f063209 100644 --- a/src/lib/libssl/src/crypto/ocsp/ocsp_lib.c +++ b/src/lib/libssl/src/crypto/ocsp/ocsp_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ocsp_lib.c,v 1.10 2014/06/12 15:49:30 deraadt Exp $ */ | 1 | /* $OpenBSD: ocsp_lib.c,v 1.11 2014/07/09 20:34:29 tedu Exp $ */ |
2 | /* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL | 2 | /* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL |
3 | * project. */ | 3 | * project. */ |
4 | 4 | ||
@@ -265,6 +265,9 @@ err: | |||
265 | free(*ppath); | 265 | free(*ppath); |
266 | free(*pport); | 266 | free(*pport); |
267 | free(*phost); | 267 | free(*phost); |
268 | *phost = NULL; | ||
269 | *pport = NULL; | ||
270 | *ppath = NULL; | ||
268 | return 0; | 271 | return 0; |
269 | } | 272 | } |
270 | 273 | ||