diff options
author | marha <marha@users.sourceforge.net> | 2015-04-20 23:05:23 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2015-04-20 23:05:23 +0200 |
commit | 0f7871ff824bcf064db3ab6bdfe26645ba6c8087 (patch) | |
tree | 90d3d2b6112e083289c9cf68146852087814f6d3 /openssl/crypto/asn1/x_x509.c | |
parent | 934184bfecd402aae891b8740d788b486aa7269f (diff) | |
parent | 2a00e489122f6c4b525090dbdba2855a2ea2d519 (diff) | |
download | vcxsrv-0f7871ff824bcf064db3ab6bdfe26645ba6c8087.tar.gz vcxsrv-0f7871ff824bcf064db3ab6bdfe26645ba6c8087.tar.bz2 vcxsrv-0f7871ff824bcf064db3ab6bdfe26645ba6c8087.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
openssl/Makefile
Diffstat (limited to 'openssl/crypto/asn1/x_x509.c')
-rw-r--r-- | openssl/crypto/asn1/x_x509.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/openssl/crypto/asn1/x_x509.c b/openssl/crypto/asn1/x_x509.c index cd838e01c..55319acf9 100644 --- a/openssl/crypto/asn1/x_x509.c +++ b/openssl/crypto/asn1/x_x509.c @@ -172,8 +172,14 @@ X509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length) { const unsigned char *q; X509 *ret; + int freeret = 0; + /* Save start position */ q = *pp; + + if(!a || *a == NULL) { + freeret = 1; + } ret = d2i_X509(a, pp, length); /* If certificate unreadable then forget it */ if (!ret) @@ -186,7 +192,11 @@ X509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length) goto err; return ret; err: - X509_free(ret); + if(freeret) { + X509_free(ret); + if (a) + *a = NULL; + } return NULL; } |