better checking for null values.

found and fixed reported by Victor Tarasov <vtarasov@idealx.com>


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1777 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
aj 2004-04-21 21:11:06 +00:00
parent 8cb6a3f94a
commit 4b4c20196b
1 changed files with 3 additions and 1 deletions

View File

@ -291,7 +291,9 @@ CK_RV slot_token_removed(int id)
/* Release framework stuff */
if (slot->card != NULL) {
if (slot->fw_data != NULL)
if (slot->fw_data != NULL &&
slot->card->framework != NULL &&
slot->card->framework->release_token != NULL)
slot->card->framework->release_token(slot->card, slot->fw_data);
slot->card->num_slots--;
}