diff --git a/bindings/java/c_kzg_4844_jni.c b/bindings/java/c_kzg_4844_jni.c index dd7ab72..5de5fe5 100644 --- a/bindings/java/c_kzg_4844_jni.c +++ b/bindings/java/c_kzg_4844_jni.c @@ -9,9 +9,12 @@ KZGSettings *settings; void reset_trusted_setup() { - free_trusted_setup(settings); - free(settings); - settings = NULL; + if (settings) + { + free_trusted_setup(settings); + free(settings); + settings = NULL; + } } void throw_exception(JNIEnv *env, const char *message)