From ad81ca9061506482bf40c9dd17097814c3ce75b2 Mon Sep 17 00:00:00 2001 From: Mouse Date: Fri, 1 Jan 2016 23:30:02 -0500 Subject: Fixed crash (SIGSEGV) when freeing of ex_data stumbles upon a NULL-pointer. Reviewed-by: Rich Salz Reviewed-by: Richard Levitte --- crypto/ex_data.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crypto/ex_data.c b/crypto/ex_data.c index f96a51781a..25e79dc2aa 100644 --- a/crypto/ex_data.c +++ b/crypto/ex_data.c @@ -522,8 +522,9 @@ static void int_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad) for (i = 0; i < mx; i++) { if (storage[i] && storage[i]->free_func) { ptr = CRYPTO_get_ex_data(ad, i); - storage[i]->free_func(obj, ptr, ad, i, - storage[i]->argl, storage[i]->argp); + if (ptr) + storage[i]->free_func(obj, ptr, ad, i, + storage[i]->argl, storage[i]->argp); } } if (storage) -- cgit v1.2.3