Skip to content

Commit fa984f9

Browse files
committed
Fix resource leaks
F-1177 & F-1178
1 parent 5210d94 commit fa984f9

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/internal.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3964,9 +3964,6 @@ static int wp11_Object_Decode_EccKey(WP11_Object* object)
39643964
sizeof(object->slot->token.key), object->iv,
39653965
sizeof(object->iv), object->devId);
39663966
}
3967-
if (ret == 0) {
3968-
ret = wc_ecc_init_ex(key, NULL, object->devId);
3969-
}
39703967
if (ret == 0) {
39713968
/* Decode ECC private key. */
39723969
ret = wc_EccPrivateKeyDecode(der, &idx, key, len);
@@ -6424,7 +6421,7 @@ void WP11_Slot_CloseSessions(WP11_Slot* slot)
64246421
WP11_Lock_LockRW(&slot->lock);
64256422
/* Finalize the rest. */
64266423
for (curr = slot->session; curr != NULL; curr = curr->next)
6427-
wp11_Session_Final(slot->session);
6424+
wp11_Session_Final(curr);
64286425
WP11_Lock_UnlockRW(&slot->lock);
64296426
}
64306427

0 commit comments

Comments
 (0)