Fixed crash (SIGSEGV) when freeing of ex_data stumbles upon a NULL-pointer.