GH837: Avoid double-free in OCSP parse.
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
This commit is contained in:
parent
2f460e1adb
commit
74d6762543
1 changed files with 9 additions and 3 deletions
|
@ -271,12 +271,18 @@ int OCSP_parse_url(const char *url, char **phost, char **pport, char **ppath,
|
|||
err:
|
||||
if (buf)
|
||||
OPENSSL_free(buf);
|
||||
if (*ppath)
|
||||
if (*ppath) {
|
||||
OPENSSL_free(*ppath);
|
||||
if (*pport)
|
||||
*ppath = NULL;
|
||||
}
|
||||
if (*pport) {
|
||||
OPENSSL_free(*pport);
|
||||
if (*phost)
|
||||
*pport = NULL;
|
||||
}
|
||||
if (*phost) {
|
||||
OPENSSL_free(*phost);
|
||||
*phost = NULL;
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue