Skip to content

Commit fae5660

Browse files
committed
fix: bring back the free functions
1 parent aaae489 commit fae5660

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

hash.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ func (h *evpHash) Clone() (HashCloner, error) {
358358
panic(err)
359359
}
360360
if _, err := ossl.EVP_MD_CTX_copy_ex(h2.ctx, h.ctx); err != nil {
361+
ossl.EVP_MD_CTX_free(h2.ctx)
361362
panic(err)
362363
}
363364
h2.ctx2, err = ossl.EVP_MD_CTX_new()

hmac.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ func (h *opensslHMAC) Clone() (HashCloner, error) {
252252
panic(err)
253253
}
254254
if _, err := ossl.HMAC_CTX_copy(ctx2, h.ctx1.ctx); err != nil {
255+
ossl.HMAC_CTX_free(ctx2)
255256
panic(err)
256257
}
257258
cl := &opensslHMAC{

0 commit comments

Comments
 (0)