pthread_mutex_unlock (&java_callbacks_lock);
ERROR ("java plugin: cjni_callback_info_create: strdup failed.");
(*jvm_env)->ReleaseStringUTFChars (jvm_env, o_name, c_name);
+ sfree (cbi);
return (NULL);
}
if (cbi->object == NULL)
{
ERROR ("java plugin: cjni_callback_info_create: NewGlobalRef failed.");
- free (cbi);
+ sfree (cbi->name);
+ sfree (cbi);
return (NULL);
}
if (cbi->class == NULL)
{
ERROR ("java plugin: cjni_callback_info_create: GetObjectClass failed.");
- free (cbi);
+ (*jvm_env)->DeleteGlobalRef (jvm_env, cbi->object);
+ sfree (cbi->name);
+ sfree (cbi);
return (NULL);
}
ERROR ("java plugin: cjni_callback_info_create: "
"Cannot find the `%s' method with signature `%s'.",
method_name, method_signature);
- free (cbi);
+ (*jvm_env)->DeleteGlobalRef (jvm_env, cbi->object);
+ sfree (cbi->name);
+ sfree (cbi);
return (NULL);
}