summaryrefslogtreecommitdiffstats
path: root/crypto/ocsp
diff options
context:
space:
mode:
authorJim Basney <jbasney@illinois.edu>2016-03-10 00:11:49 +0100
committerRich Salz <rsalz@akamai.com>2016-03-10 02:44:52 +0100
commitdca7158c954679757e216a0179f9014f86f6ed44 (patch)
tree3e348a3fc0eb315102a0d20d148fe711b9af0110 /crypto/ocsp
parentFix return type for CRYPTO_THREAD_run_once (diff)
downloadopenssl-dca7158c954679757e216a0179f9014f86f6ed44.tar.xz
openssl-dca7158c954679757e216a0179f9014f86f6ed44.zip
Avoid double-free in calleres to OCSP_parse_url
set pointers to NULL after OPENSSL_free before returning to caller to avoid possible double-free in caller Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/ocsp')
-rw-r--r--crypto/ocsp/ocsp_lib.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/ocsp/ocsp_lib.c b/crypto/ocsp/ocsp_lib.c
index 1aaa290a4a..8814190146 100644
--- a/crypto/ocsp/ocsp_lib.c
+++ b/crypto/ocsp/ocsp_lib.c
@@ -266,8 +266,11 @@ int OCSP_parse_url(const char *url, char **phost, char **pport, char **ppath,
err:
OPENSSL_free(buf);
OPENSSL_free(*ppath);
+ *ppath = NULL;
OPENSSL_free(*pport);
+ *pport = NULL;
OPENSSL_free(*phost);
+ *phost = NULL;
return 0;
}