Add NULL check for pmksa cache free_cb() callback

free_cb can be NULL during the pmksa_cache_auth_init() from the modules
using libpasn.so. So check it explicitly before dereferencing.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This commit is contained in:
Vinay Gannevaram 2023-10-11 16:32:23 +05:30 committed by Jouni Malinen
parent 97b6cc6e58
commit c860647160

View file

@ -56,6 +56,8 @@ void pmksa_cache_free_entry(struct rsn_pmksa_cache *pmksa,
unsigned int hash; unsigned int hash;
pmksa->pmksa_count--; pmksa->pmksa_count--;
if (pmksa->free_cb)
pmksa->free_cb(entry, pmksa->ctx); pmksa->free_cb(entry, pmksa->ctx);
/* unlink from hash list */ /* unlink from hash list */