Make crypto_free_pk_env tolerate NULL arg in 0.2.1. Error-proofing against bug 988 backport

This commit is contained in:
Nick Mathewson
2010-11-12 20:21:50 -05:00
committed by Sebastian Hahn
parent 9976df9e56
commit 299a78c5fe
+2 -1
View File
@@ -321,7 +321,8 @@ crypto_new_pk_env(void)
void
crypto_free_pk_env(crypto_pk_env_t *env)
{
tor_assert(env);
if (!env)
return;
if (--env->refs > 0)
return;