]> git.ipfire.org Git - thirdparty/krb5.git/commit
Fix memory leaks in soft-pkcs11 code 963/head
authorGreg Hudson <ghudson@mit.edu>
Mon, 5 Aug 2019 05:53:51 +0000 (01:53 -0400)
committerGreg Hudson <ghudson@mit.edu>
Tue, 6 Aug 2019 01:18:34 +0000 (21:18 -0400)
commit15bcaf8bcb4af25ff89820ad3bf23ad5a324e863
tree65e1e11fe71eefbe851128115fe1671495f6ef71
parentdbcec74b277952adf6e49d087932d2d0ea5393d1
Fix memory leaks in soft-pkcs11 code

Fix leaks detected by asan in t_pkinit.py.  Add a helper to free a
struct st_object and free objects in C_Finalize().  Duplicate the X509
cert in add_certificate() instead of creating aliases so it can be
properly freed.  Start the session handle counter at 1 so that
C_Finalize() won't confuse the first session handle with
CK_INVALID_HANDLE (defined to 0 in pkinit.h) and will properly clean
the session object.
src/tests/softpkcs11/main.c