Don't access freed memory
The fields array contains pointers into the value_copy string.
The fields array contains pointers into the value_copy string.
Fix error message
Merge branch 'collectd-5.4' into collectd-5.5
Fix harmless build warnings with newer binutils
I see a lot of those on Rawhide:
ar: `u' modifier ignored since `D' is the default (see `U')
It's going to take a while to get this fixed upstream.
Meanwhile, silence the warnings.
Macro copied from libvirt.
I see a lot of those on Rawhide:
ar: `u' modifier ignored since `D' is the default (see `U')
It's going to take a while to get this fixed upstream.
Meanwhile, silence the warnings.
Macro copied from libvirt.
liboconfig: Fix implicit declaration warning
strlen declaration is in string.h
strlen declaration is in string.h
Don't unlock lock twice
Fixes make check on OpenBSD
Fixes make check on OpenBSD
pf: fix compilation on OpenBSD
dns: fix compilation on OpenBSD
OpenBSD doesn't have pcap-bpf.h
pcap.h has been including pcap/bpf.h since 2006.
Since we require a pcap which has PCAP_ERROR_IFACE_NOT_UP, introduced in 2008
this shouldn't break anything.
OpenBSD doesn't have pcap-bpf.h
pcap.h has been including pcap/bpf.h since 2006.
Since we require a pcap which has PCAP_ERROR_IFACE_NOT_UP, introduced in 2008
this shouldn't break anything.
Fix pipe leak in exec plugin
Fixes #762
Fixes #762
ltdl: only compile included libltdl when needed
If configure finds an external libltdl, it's going to
use it, so there's no use in compiling the shipped libltdl.
If configure finds an external libltdl, it's going to
use it, so there's no use in compiling the shipped libltdl.
Merge branch 'collectd-5.4' into collectd-5.5
routeros: fix a small build error pointed out by clang
routeros.c:334:35: error: 'memset' call operates on objects of type 'cr_data_t' (aka 'struct cr_data_s') while the size is based on a different type 'cr_data_t *' (aka 'struct cr_data_s *') [-Werror,-Wsizeof-pointer-memaccess]
memset (router_data, 0, sizeof (router_data));
~~~~~~~~~~~ ^~~~~~~~~~~
routeros.c:334:35: note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)?
memset (router_data, 0, sizeof (router_data));
^~~~~~~~~~~
routeros.c:334:35: error: 'memset' call operates on objects of type 'cr_data_t' (aka 'struct cr_data_s') while the size is based on a different type 'cr_data_t *' (aka 'struct cr_data_s *') [-Werror,-Wsizeof-pointer-memaccess]
memset (router_data, 0, sizeof (router_data));
~~~~~~~~~~~ ^~~~~~~~~~~
routeros.c:334:35: note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)?
memset (router_data, 0, sizeof (router_data));
^~~~~~~~~~~
ipc: enable _GNU_SOURCE to fix build with musl libc
This fixes compile the compile error:
> ipc.c:154:49: error: 'struct shm_info' has no member named 'used_ids'
> ipc_submit_g("shm", "segments", NULL, shm_info.used_ids);
> ^
Fixes #1147
This fixes compile the compile error:
> ipc.c:154:49: error: 'struct shm_info' has no member named 'used_ids'
> ipc_submit_g("shm", "segments", NULL, shm_info.used_ids);
> ^
Fixes #1147
Revert "amqp: look for librabbitmq in /usr/local as well"
This reverts commit c1c5087fd5d9e66427cee8c98c523519d578bee6.
... as a follow-up to the discussion which took place in #1201
This reverts commit c1c5087fd5d9e66427cee8c98c523519d578bee6.
... as a follow-up to the discussion which took place in #1201
fhcount: this plugin only works on Linux
Merge branch 'collectd-5.4' into collectd-5.5
logstash: initialize conf struct to 0
With YAJL 1 (at least on Ubuntu Precise), if `conf.indentString` is not
initialized correctly, we would get a segfault even when `conf.beautify`
is set to 0. We avoid this case by initializing the whole structure to
0. `conf.beautify = 0` is kept for explicitness.
With YAJL 1 (at least on Ubuntu Precise), if `conf.indentString` is not
initialized correctly, we would get a segfault even when `conf.beautify`
is set to 0. We avoid this case by initializing the whole structure to
0. `conf.beautify = 0` is kept for explicitness.
Fix libmodbus detection on FreeBSD
We look for modbus/modbus.h in /usr/local/include/modbus
but we should look for modbus.h
This is only an issue on FreeBSD since /usr/local/include is not
in the default search path.
We look for modbus/modbus.h in /usr/local/include/modbus
but we should look for modbus.h
This is only an issue on FreeBSD since /usr/local/include is not
in the default search path.
amqp: look for librabbitmq in /usr/local as well
This detects it automatically on FreeBSD.
Ideally we should just use pkg-config but that is
left as an exercise for the reader ;)
This detects it automatically on FreeBSD.
Ideally we should just use pkg-config but that is
left as an exercise for the reader ;)
Fix varnish detection on FreeBSD
We look for varnish/vapi/vsc.h in /usr/include/varnish
but we should look for vapi/vsc.h
This is only an issue on FreeBSD since /usr/local/include is not
in the default search path.
We look for varnish/vapi/vsc.h in /usr/include/varnish
but we should look for vapi/vsc.h
This is only an issue on FreeBSD since /usr/local/include is not
in the default search path.
irq: skip FIQ line in /proc/interrupts
/proc/interrupts on my Raspberry PI contains:
FIQ: usb_fiq
This line doesn't contain any per cpu counters
but we try to parse it anyway, resulting in:
parse_value: Failed to parse string as derive: usb_fiq.
Fixes #971
/proc/interrupts on my Raspberry PI contains:
FIQ: usb_fiq
This line doesn't contain any per cpu counters
but we try to parse it anyway, resulting in:
parse_value: Failed to parse string as derive: usb_fiq.
Fixes #971
configure.ac: remove some redundant x'es
configure.ac: fix indentation
Fix a memory leak on shutdown
Merge branch 'collectd-5.4' into collectd-5.5
Add utils_parse_option.c/h to amqp plugin source files list
collectd -T: fix memory leak
Fix some small leaks on error paths
liboconfig: really fix lex warnings
Flex has two options to disable input and unput.
Turn them on.
Flex has two options to disable input and unput.
Turn them on.
Add remark about length of HostnameFormat string in virt plugin
Use standard ints in write_kafka plugin for portability
src/utils_latency.c: Fix format string error.
src/utils_latency.c: Ensure that LLONG_MAX is defined.
EPEL5 doesn't have it in <limits.h> apparently.
EPEL5 doesn't have it in <limits.h> apparently.
src/utils_latency.c: Store "bin_width" as cdtime_t.
This solves the integer overflow when passing huge latency values to
latency_counter_add(). In addition to fixing the overflow the function
will now ignore values that are larger than LLONG_MAX, i.e. the longest
possible latency is 272 years. As a nice side-effect, the precission of
latency_counter_get_percentile() is improved.
Issue: #1131
This solves the integer overflow when passing huge latency values to
latency_counter_add(). In addition to fixing the overflow the function
will now ignore values that are larger than LLONG_MAX, i.e. the longest
possible latency is 272 years. As a nice side-effect, the precission of
latency_counter_get_percentile() is improved.
Issue: #1131
src/utils_latency.c: Fix change_bin_width().
A missing cast when calculating "width_change_ratio" caused all metrics to
be moved to bucket #0.
A missing cast when calculating "width_change_ratio" caused all metrics to
be moved to bucket #0.
varnish: fix leak on read
Since VSM_Close doesn't free the object we leak a few bytes
every interval
Since VSM_Close doesn't free the object we leak a few bytes
every interval
varnish: fix some leaks in error paths
fix leak on exit
plugin.c: plug leak on error
memcached: plug leak
gmond: plug a small leak on exit
collectd.conf.pod: correct a tiny typo
Merge branch 'collectd-5.4' into collectd-5.5
build: add libavltree, libcommon & libheap dependencies
Otherwise it can break on very parallel builds since collectd link time
arrives before one or more of these were built.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Otherwise it can break on very parallel builds since collectd link time
arrives before one or more of these were built.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Add test-suite logs to .gitignore
collectd.conf: order plugins alphabetically again
Fix Perl errors
"my" variable $cmd masks earlier declaration in same scope at /tmp/contrib_collectd2html.pl line 223.
syntax error at /tmp/contrib_collectd2html.pl line 219, near "$span qw(1hour 1day 1week 1month)"
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 221.
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 224.
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 225.
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 232.
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 237.
syntax error at /tmp/contrib_collectd2html.pl line 245, near "}"
"my" variable $cmd masks earlier declaration in same scope at /tmp/contrib_collectd2html.pl line 223.
syntax error at /tmp/contrib_collectd2html.pl line 219, near "$span qw(1hour 1day 1week 1month)"
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 221.
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 224.
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 225.
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 232.
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 237.
syntax error at /tmp/contrib_collectd2html.pl line 245, near "}"
bind: fix zone count check
Merge branch 'collectd-5.4' into collectd-5.5
src/daemon/common.c: Fix off-by-one error in escape_slashes().
Partial cherry-pick of 0cba91923be9326224f8434e4aae7691f7b6dad1.
Partial cherry-pick of 0cba91923be9326224f8434e4aae7691f7b6dad1.
properly handle error cases when kvm_read fails (#1094)
don't report inodes if fs doesn't provide f_files and f_ffree
write_redis plugin: Call freeReplyObject() for each redisReply.
barometer plugin: Fix "Allocator sizeof operand mismatch" warning.
write_sensu plugin: Fix debug message.
It still referenced the variables, which have been removed in
1c4008c3216edbc9c7cbeffd1c597c9b32e8f64d.
It still referenced the variables, which have been removed in
1c4008c3216edbc9c7cbeffd1c597c9b32e8f64d.
write_sensu plugin: Fix memory leak.
turbostat plugin: Fix "Undefined allocation of 0 bytes (CERT MEM04-C; CWE-131)" warning.
openvpn plugin: Fix "Dead assignment" warning.
Merge branch 'collectd-5.4' into collectd-5.5
src/utils_cmd_flush.c: Fix memory leak.
src/utils_rrdcreate.c: Fix memory leak.
src/utils_ignorelist.c: Fix memory leak.
Turns out, regfree(3) cleans up the memory allocated by regcomp(3), but
not the pointer itself.
Turns out, regfree(3) cleans up the memory allocated by regcomp(3), but
not the pointer itself.
src/utils_cmd_putval.c: Fix memory leak.
utils_cache plugin: Fix memory leak.
rrdtool plugin: Add assertion.
This helps the static code analysis to figure out that memory is not
leaking after all.
This helps the static code analysis to figure out that memory is not
leaking after all.
powerdns plugin: Fix memory leak.
While at it, replace the powerdns_config_add_string() function.
While at it, replace the powerdns_config_add_string() function.
memcachec plugin: Fix memory leak.
java plugin: Fix memory leak.
ipvs plugin: Fix memory leak.
gmond plugin: Fix memory leak.
curl_xml plugin: Fix memory leak.
curl_json plugin: Fix memory leak.
curl plugin: Fix memory leak.
collectdmon: Fix memory leak.
apache plugin: Fix memory leak.
src/utils_cache.c: Fix two memory leaks.
* Free "times" pointer if it is not returned to the user.
* Free (re)alloc'ed pointers when strdup() fails.
* Free "times" pointer if it is not returned to the user.
* Free (re)alloc'ed pointers when strdup() fails.
snmp plugin: Fix "Assigned value is garbage or undefined" warning.
src/utils_latency.c: Fix "Assigned value is garbage or undefined" warning.
threshold plugin: Fix "Dead assignment" warnings.
Merge branch 'collectd-5.4' into collectd-5.5
modbus plugin: Make sure variable is initialized.
This was introduced by the merge
(09c6a320f3cb36b5dbb2c2ce43858f33be7acf9b).
This was introduced by the merge
(09c6a320f3cb36b5dbb2c2ce43858f33be7acf9b).
stats plugin: Link with libm (-lm).
Fixes a bug reported by @Tenzer:
symbol lookup error: /usr/lib/collectd/statsd.so: undefined symbol: log
Fixes a bug reported by @Tenzer:
symbol lookup error: /usr/lib/collectd/statsd.so: undefined symbol: log
tail plugin: Make sure variable is initialized.
This was introduced by the merge
(09c6a320f3cb36b5dbb2c2ce43858f33be7acf9b).
This was introduced by the merge
(09c6a320f3cb36b5dbb2c2ce43858f33be7acf9b).
Fix "Undefined allocation of 0 bytes (CERT MEM04-C; CWE-131)" warnings.
threshold plugin: Fix "Dead increment" warnings.
Fix "Argument with 'nonnull' attribute passed null" warnings.
Merge branch 'collectd-5.4' into collectd-5.5
threshold plugin: Fix "Dead assignment" warning.
ted plugin: Fix "Dead assignment" warning.
tail_csv plugin: Fix "Dead assignment" warning.
tail plugin: Fix "Dead assignment" warning.
snmp plugin: Fix "Dead assignment" warning.
powerdns plugin: Fix "Dead assignment" warning.
ping plugin: Fix "Dead assignment" warning.
onewire plugin: Fix "Dead assignment" warning.
openvpn plugin: Fix "Dead assignment" warning.
ntpd plugin: Fix "Dead assignment" warning.
network plugin: Fix "Dead assignment" warning.