diff options
author | 2014-09-28 10:53:57 +0000 | |
---|---|---|
committer | 2014-09-28 10:53:57 +0000 | |
commit | 62c1f8aee771875e910a873fb4b4f5013d0b27d3 (patch) | |
tree | d900d64840cf7283f625125d38e3effdebafcd0e /lib/libssl/src | |
parent | X509_TRUST_add(): check X509_TRUST_get0() return value before dereferencing it, (diff) | |
download | wireguard-openbsd-62c1f8aee771875e910a873fb4b4f5013d0b27d3.tar.xz wireguard-openbsd-62c1f8aee771875e910a873fb4b4f5013d0b27d3.zip |
X509v3_add_ext(): do not free stuff we did not allocate in the error path.
ok bcook@
Diffstat (limited to 'lib/libssl/src')
-rw-r--r-- | lib/libssl/src/crypto/x509/x509_v3.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libssl/src/crypto/x509/x509_v3.c b/lib/libssl/src/crypto/x509/x509_v3.c index a745e6f71ba..3d3a96f59b7 100644 --- a/lib/libssl/src/crypto/x509/x509_v3.c +++ b/lib/libssl/src/crypto/x509/x509_v3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_v3.c,v 1.10 2014/07/11 08:44:49 jsing Exp $ */ +/* $OpenBSD: x509_v3.c,v 1.11 2014/09/28 10:53:57 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -185,7 +185,7 @@ err: err2: if (new_ex != NULL) X509_EXTENSION_free(new_ex); - if (sk != NULL) + if (sk != NULL && (x != NULL && sk != *x)) sk_X509_EXTENSION_free(sk); return (NULL); } |