defensive if

This commit is contained in:
Stefan Bratanov 2022-12-18 11:13:26 +02:00
parent d06df97716
commit b6c0beaf8b
1 changed files with 6 additions and 3 deletions

View File

@ -9,9 +9,12 @@ KZGSettings *settings;
void reset_trusted_setup() void reset_trusted_setup()
{ {
free_trusted_setup(settings); if (settings)
free(settings); {
settings = NULL; free_trusted_setup(settings);
free(settings);
settings = NULL;
}
} }
void throw_exception(JNIEnv *env, const char *message) void throw_exception(JNIEnv *env, const char *message)