summaryrefslogtreecommitdiffstats
path: root/crypto/x509
diff options
context:
space:
mode:
authorIsmo Puustinen <ismo.puustinen@intel.com>2015-08-07 22:11:28 -0400
committerRich Salz <rsalz@openssl.org>2015-08-13 12:15:22 -0400
commit25efcb44ac88ab34f60047e16a96c9462fad39c1 (patch)
tree7b86886312fe2d8d81726e9561a34178864bf706 /crypto/x509
parent5859bc62f3dc79aea2844f0349cfa9dcbd570dfb (diff)
GH364: Free memory on an error path
Part of RT 3997 Per Ben, just jump to common exit code. Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit cc2829e6641092abed8360433dbe67e883fd1cc6)
Diffstat (limited to 'crypto/x509')
-rw-r--r--crypto/x509/x509_vfy.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c
index a2f1dbefe3..26c6bb3b11 100644
--- a/crypto/x509/x509_vfy.c
+++ b/crypto/x509/x509_vfy.c
@@ -354,7 +354,8 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
if (!sk_X509_push(ctx->chain, x)) {
X509_free(xtmp);
X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE);
- return 0;
+ ok = 0;
+ goto done;
}
num++;
}