projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'collectd-5.5'
[collectd.git]
/
src
/
java.c
diff --git
a/src/java.c
b/src/java.c
index
a6b8022
..
4187e7c
100644
(file)
--- a/
src/java.c
+++ b/
src/java.c
@@
-618,7
+618,7
@@
static jobject ctoj_data_set (JNIEnv *jvm_env, const data_set_t *ds) /* {{{ */
jmethodID m_add;
jobject o_type;
jobject o_dataset;
jmethodID m_add;
jobject o_type;
jobject o_dataset;
-
in
t i;
+
size_
t i;
/* Look up the org/collectd/api/DataSet class */
c_dataset = (*jvm_env)->FindClass (jvm_env, "org/collectd/api/DataSet");
/* Look up the org/collectd/api/DataSet class */
c_dataset = (*jvm_env)->FindClass (jvm_env, "org/collectd/api/DataSet");
@@
-763,7
+763,7
@@
static jobject ctoj_value_list (JNIEnv *jvm_env, /* {{{ */
jmethodID m_valuelist_constructor;
jobject o_valuelist;
int status;
jmethodID m_valuelist_constructor;
jobject o_valuelist;
int status;
-
in
t i;
+
size_
t i;
/* First, create a new ValueList instance..
* Look up the class.. */
/* First, create a new ValueList instance..
* Look up the class.. */
@@
-1801,14
+1801,13
@@
static cjni_callback_info_t *cjni_callback_info_create (JNIEnv *jvm_env, /* {{{
return (NULL);
}
return (NULL);
}
- cbi =
(cjni_callback_info_t *) malloc (
sizeof (*cbi));
+ cbi =
calloc (1,
sizeof (*cbi));
if (cbi == NULL)
{
if (cbi == NULL)
{
- ERROR ("java plugin: cjni_callback_info_create:
m
alloc failed.");
+ ERROR ("java plugin: cjni_callback_info_create:
c
alloc failed.");
(*jvm_env)->ReleaseStringUTFChars (jvm_env, o_name, c_name);
return (NULL);
}
(*jvm_env)->ReleaseStringUTFChars (jvm_env, o_name, c_name);
return (NULL);
}
- memset (cbi, 0, sizeof (*cbi));
cbi->type = type;
cbi->name = strdup (c_name);
cbi->type = type;
cbi->name = strdup (c_name);
@@
-1906,7
+1905,7
@@
static int cjni_callback_register (JNIEnv *jvm_env, /* {{{ */
pthread_mutex_lock (&java_callbacks_lock);
pthread_mutex_lock (&java_callbacks_lock);
- tmp =
(cjni_callback_info_t *)
realloc (java_callbacks,
+ tmp = realloc (java_callbacks,
(java_callbacks_num + 1) * sizeof (*java_callbacks));
if (tmp == NULL)
{
(java_callbacks_num + 1) * sizeof (*java_callbacks));
if (tmp == NULL)
{
@@
-2067,13
+2066,12
@@
static JNIEnv *cjni_thread_attach (void) /* {{{ */
if (cjni_env == NULL)
{
/* This pointer is free'd in `cjni_jvm_env_destroy'. */
if (cjni_env == NULL)
{
/* This pointer is free'd in `cjni_jvm_env_destroy'. */
- cjni_env =
(cjni_jvm_env_t *) malloc (
sizeof (*cjni_env));
+ cjni_env =
calloc (1,
sizeof (*cjni_env));
if (cjni_env == NULL)
{
if (cjni_env == NULL)
{
- ERROR ("java plugin: cjni_thread_attach:
m
alloc failed.");
+ ERROR ("java plugin: cjni_thread_attach:
c
alloc failed.");
return (NULL);
}
return (NULL);
}
- memset (cjni_env, 0, sizeof (*cjni_env));
cjni_env->reference_counter = 0;
cjni_env->jvm_env = NULL;
cjni_env->reference_counter = 0;
cjni_env->jvm_env = NULL;
@@
-2169,7
+2167,7
@@
static int cjni_config_add_jvm_arg (oconfig_item_t *ci) /* {{{ */
return (-1);
}
return (-1);
}
- tmp =
(char **)
realloc (jvm_argv, sizeof (char *) * (jvm_argc + 1));
+ tmp = realloc (jvm_argv, sizeof (char *) * (jvm_argc + 1));
if (tmp == NULL)
{
ERROR ("java plugin: realloc failed.");
if (tmp == NULL)
{
ERROR ("java plugin: realloc failed.");
@@
-2205,7
+2203,7
@@
static int cjni_config_load_plugin (oconfig_item_t *ci) /* {{{ */
if (jvm_env == NULL)
return (-1);
if (jvm_env == NULL)
return (-1);
- class =
(java_plugin_class_t *)
realloc (java_classes_list,
+ class = realloc (java_classes_list,
(java_classes_list_len + 1) * sizeof (*java_classes_list));
if (class == NULL)
{
(java_classes_list_len + 1) * sizeof (*java_classes_list));
if (class == NULL)
{
@@
-2801,13
+2799,13
@@
static int cjni_match_target_create (const oconfig_item_t *ci, /* {{{ */
/* Allocate a new callback info structure. This is going to be our user_data
* pointer. */
/* Allocate a new callback info structure. This is going to be our user_data
* pointer. */
- cbi_ret =
(cjni_callback_info_t *) malloc (
sizeof (*cbi_ret));
+ cbi_ret =
calloc (1,
sizeof (*cbi_ret));
if (cbi_ret == NULL)
{
if (cbi_ret == NULL)
{
- ERROR ("java plugin: cjni_match_target_create:
m
alloc failed.");
+ ERROR ("java plugin: cjni_match_target_create:
c
alloc failed.");
BAIL_OUT (-1);
}
BAIL_OUT (-1);
}
- memset (cbi_ret, 0, sizeof (*cbi_ret));
+
cbi_ret->object = NULL;
cbi_ret->type = type;
cbi_ret->object = NULL;
cbi_ret->type = type;