summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0750cc1)
raw | patch | inline | side by side (parent: 0750cc1)
author | Florian Forster <octo@collectd.org> | |
Fri, 19 Jun 2015 08:54:02 +0000 (10:54 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Fri, 19 Jun 2015 08:54:02 +0000 (10:54 +0200) |
src/java.c | patch | blob | history |
diff --git a/src/java.c b/src/java.c
index 10d837e6701fcc9f4532b0a4f19c4c5e12a03532..ee14373ed9f75485a91b9dc3b93283f8e4eafcd9 100644 (file)
--- a/src/java.c
+++ b/src/java.c
@@ -1790,6 +1790,7 @@ static cjni_callback_info_t *cjni_callback_info_create (JNIEnv *jvm_env, /* {{{
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);
}
@@ -1799,7 +1800,8 @@ static cjni_callback_info_t *cjni_callback_info_create (JNIEnv *jvm_env, /* {{{
if (cbi->object == NULL)
{
ERROR ("java plugin: cjni_callback_info_create: NewGlobalRef failed.");
- free (cbi);
+ sfree (cbi->name);
+ sfree (cbi);
return (NULL);
}
@@ -1807,7 +1809,9 @@ static cjni_callback_info_t *cjni_callback_info_create (JNIEnv *jvm_env, /* {{{
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);
}
@@ -1818,7 +1822,9 @@ static cjni_callback_info_t *cjni_callback_info_create (JNIEnv *jvm_env, /* {{{
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);
}