static void dcrypt_openssl_unref_public_key(struct dcrypt_public_key **key)
{
- i_assert(key != NULL && *key != NULL);
+ i_assert(key != NULL);
struct dcrypt_public_key *_key = *key;
+ if (_key == NULL)
+ return;
i_assert(_key->ref > 0);
*key = NULL;
if (--_key->ref > 0) return;
static void dcrypt_openssl_unref_private_key(struct dcrypt_private_key **key)
{
- i_assert(key != NULL && *key != NULL);
+ i_assert(key != NULL);
struct dcrypt_private_key *_key = *key;
+ if (_key == NULL)
+ return;
i_assert(_key->ref > 0);
*key = NULL;
if (--_key->ref > 0) return;