projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
postgresql plugin: Register a new user data pointer with udb_query_set_user_data...
[collectd.git]
/
src
/
plugin.c
diff --git
a/src/plugin.c
b/src/plugin.c
index
cb1005e
..
6d3d3c9
100644
(file)
--- a/
src/plugin.c
+++ b/
src/plugin.c
@@
-181,13
+181,13
@@
static void destroy_read_heap (void) /* {{{ */
while (42)
{
while (42)
{
-
callback_func_t *c
f;
+
read_func_t *r
f;
-
c
f = c_heap_get_root (read_heap);
- if (
c
f == NULL)
+
r
f = c_heap_get_root (read_heap);
+ if (
r
f == NULL)
break;
break;
-
- destroy_callback (
c
f);
+ sfree (rf->rf_name);
+ destroy_callback (
(callback_func_t *) r
f);
}
c_heap_destroy (read_heap);
}
c_heap_destroy (read_heap);
@@
-1133,8
+1133,10
@@
int plugin_register_read (const char *name,
rf->rf_interval = plugin_get_interval ();
status = plugin_insert_read (rf);
rf->rf_interval = plugin_get_interval ();
status = plugin_insert_read (rf);
- if (status != 0)
+ if (status != 0) {
+ sfree (rf->rf_name);
sfree (rf);
sfree (rf);
+ }
return (status);
} /* int plugin_register_read */
return (status);
} /* int plugin_register_read */
@@
-1181,8
+1183,10
@@
int plugin_register_complex_read (const char *group, const char *name,
rf->rf_ctx = plugin_get_ctx ();
status = plugin_insert_read (rf);
rf->rf_ctx = plugin_get_ctx ();
status = plugin_insert_read (rf);
- if (status != 0)
+ if (status != 0) {
+ sfree (rf->rf_name);
sfree (rf);
sfree (rf);
+ }
return (status);
} /* int plugin_register_complex_read */
return (status);
} /* int plugin_register_complex_read */
@@
-1497,8
+1501,6
@@
void plugin_init_all (void)
write_threads_num = 5;
}
write_threads_num = 5;
}
- start_write_threads ((size_t) write_threads_num);
-
if ((list_init == NULL) && (read_heap == NULL))
return;
if ((list_init == NULL) && (read_heap == NULL))
return;
@@
-1534,6
+1536,8
@@
void plugin_init_all (void)
le = le->next;
}
le = le->next;
}
+ start_write_threads ((size_t) write_threads_num);
+
/* Start read-threads */
if (read_heap != NULL)
{
/* Start read-threads */
if (read_heap != NULL)
{
@@
-1601,6
+1605,7
@@
int plugin_read_all_once (void)
return_status = -1;
}
return_status = -1;
}
+ sfree (rf->rf_name);
destroy_callback ((void *) rf);
}
destroy_callback ((void *) rf);
}