aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/c_src/hmac.c
diff options
context:
space:
mode:
authorDoug Hogan <[email protected]>2019-01-14 21:44:49 -0800
committerDoug Hogan <[email protected]>2019-01-14 21:45:16 -0800
commit3b51e7933ba42b3299ba0678ce1b4d8a844064cd (patch)
tree73c355ace1dd1bac0a6cae54be396e9991acd7c7 /lib/crypto/c_src/hmac.c
parentc91aecddbd0b1d0aac889da5cf4f8aed8d75637c (diff)
downloadotp-3b51e7933ba42b3299ba0678ce1b4d8a844064cd.tar.gz
otp-3b51e7933ba42b3299ba0678ce1b4d8a844064cd.tar.bz2
otp-3b51e7933ba42b3299ba0678ce1b4d8a844064cd.zip
enif_release_resource is not NULL safe
* Add if checks and update coccinelle script.
Diffstat (limited to 'lib/crypto/c_src/hmac.c')
-rw-r--r--lib/crypto/c_src/hmac.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/crypto/c_src/hmac.c b/lib/crypto/c_src/hmac.c
index a5ff35c706..9418e7950e 100644
--- a/lib/crypto/c_src/hmac.c
+++ b/lib/crypto/c_src/hmac.c
@@ -169,7 +169,8 @@ ERL_NIF_TERM hmac_init_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
ret = atom_notsup;
done:
- enif_release_resource(obj);
+ if (obj)
+ enif_release_resource(obj);
return ret;
}