diff options
| author | tedu <> | 2014-07-09 20:34:29 +0000 |
|---|---|---|
| committer | tedu <> | 2014-07-09 20:34:29 +0000 |
| commit | 06802d091c647eaccb4c6927c4214c99e3fb89be (patch) | |
| tree | f6603d3b882b0dd522c90f24b9d29f827b4d28fd | |
| parent | 339966bb414002d1ebf82bc093838eefca689911 (diff) | |
| download | openbsd-06802d091c647eaccb4c6927c4214c99e3fb89be.tar.gz openbsd-06802d091c647eaccb4c6927c4214c99e3fb89be.tar.bz2 openbsd-06802d091c647eaccb4c6927c4214c99e3fb89be.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 '')
| -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 | ||
