message: pointer checked before assigning
diff: @@ -31,12 +31,12 @@ void throwException(JNIEnv* env, const char* clazz, const char* fmt, ...) {
  va_start(args, fmt);
  const size_t max_msg_len = 512;
  auto* message = static_cast<char*>(malloc(max_msg_len));
  - if (vsnprintf(message, max_msg_len, fmt, args) >= 0) {
  + if (message && (vsnprintf(message, max_msg_len, fmt, args) >= 0)) {
  env->ThrowNew(env->FindClass(clazz), message);
  + free(message);
  } else {
  env->ThrowNew(env->FindClass(clazz), "");
  }
  - free(message);
  va_end(args);
  }
  