summaryrefslogtreecommitdiffstats
path: root/sys/opencrypto
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2006-03-28 08:33:30 +0000
committerpjd <pjd@FreeBSD.org>2006-03-28 08:33:30 +0000
commit0b67f9b4ea343d82d6572f06bdbe7d6fcfae2e76 (patch)
tree78f34ad5c65bd2a0b1a28f2ae7c39fde92ab8064 /sys/opencrypto
parent39501d50faab1ddba0eecc3f23503bce39d6769f (diff)
downloadFreeBSD-src-0b67f9b4ea343d82d6572f06bdbe7d6fcfae2e76.zip
FreeBSD-src-0b67f9b4ea343d82d6572f06bdbe7d6fcfae2e76.tar.gz
Fix memory leak which occurs when crypto.ko module is unloaded.
Discussed with: sam MFC after 3 days
Diffstat (limited to 'sys/opencrypto')
-rw-r--r--sys/opencrypto/cryptosoft.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/opencrypto/cryptosoft.c b/sys/opencrypto/cryptosoft.c
index d251d96..9cd2250 100644
--- a/sys/opencrypto/cryptosoft.c
+++ b/sys/opencrypto/cryptosoft.c
@@ -1028,3 +1028,12 @@ swcr_init(void)
#undef REGISTER
}
SYSINIT(cryptosoft_init, SI_SUB_PSEUDO, SI_ORDER_ANY, swcr_init, NULL)
+
+static void
+swcr_uninit(void)
+{
+
+ if (swcr_sessions != NULL)
+ FREE(swcr_sessions, M_CRYPTO_DATA);
+}
+SYSUNINIT(cryptosoft_uninit, SI_SUB_PSEUDO, SI_ORDER_ANY, swcr_uninit, NULL);
OpenPOWER on IntegriCloud