Move freeing pointers in highlevelcrypto.pointMult() to finally branch
like it's done in pyelliptic.
This commit is contained in:
parent
0fc5cd5927
commit
cdd73f9ac0
|
@ -134,9 +134,6 @@ def pointMult(secret):
|
|||
mb = OpenSSL.create_string_buffer(size)
|
||||
OpenSSL.i2o_ECPublicKey(k, OpenSSL.byref(OpenSSL.pointer(mb)))
|
||||
|
||||
OpenSSL.EC_POINT_free(pub_key)
|
||||
OpenSSL.BN_free(priv_key)
|
||||
OpenSSL.EC_KEY_free(k)
|
||||
return mb.raw
|
||||
|
||||
except Exception:
|
||||
|
@ -144,3 +141,7 @@ def pointMult(secret):
|
|||
import time
|
||||
traceback.print_exc()
|
||||
time.sleep(0.2)
|
||||
finally:
|
||||
OpenSSL.EC_POINT_free(pub_key)
|
||||
OpenSSL.BN_free(priv_key)
|
||||
OpenSSL.EC_KEY_free(k)
|
||||
|
|
Reference in New Issue
Block a user