diff options
author | 2014-04-18 03:28:12 +0000 | |
---|---|---|
committer | 2014-04-18 03:28:12 +0000 | |
commit | 3c4f16091673123e50172b73d2097387c411e1e2 (patch) | |
tree | 9c0cabfe28a8e7a30dc6d64293c7732f02be069d /lib/libssl/src | |
parent | -netware (diff) | |
download | wireguard-openbsd-3c4f16091673123e50172b73d2097387c411e1e2.tar.xz wireguard-openbsd-3c4f16091673123e50172b73d2097387c411e1e2.zip |
fix another potential double free
ok miod@ lteo@ jca@
Diffstat (limited to 'lib/libssl/src')
-rw-r--r-- | lib/libssl/src/crypto/pkcs7/pk7_doit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libssl/src/crypto/pkcs7/pk7_doit.c b/lib/libssl/src/crypto/pkcs7/pk7_doit.c index 396a863f3bb..fbe58cd45f0 100644 --- a/lib/libssl/src/crypto/pkcs7/pk7_doit.c +++ b/lib/libssl/src/crypto/pkcs7/pk7_doit.c @@ -928,6 +928,7 @@ int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si) if (EVP_DigestSignUpdate(&mctx,abuf,alen) <= 0) goto err; free(abuf); + abuf = NULL; if (EVP_DigestSignFinal(&mctx, NULL, &siglen) <= 0) goto err; abuf = malloc(siglen); @@ -950,8 +951,7 @@ int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si) return 1; err: - if (abuf) - free(abuf); + free(abuf); EVP_MD_CTX_cleanup(&mctx); return 0; |