monitoring-plugins/lib
Andreas Ericsson 364ce21b10 lib/utils_base.c: Stop dumping core on bad args to check_snmp
Since the state patch introduction, we've been freeing uninitialized
memory in lib/utils_base.c::np_cleanup(), which caused coredumps
with check_snmp when illegal threshold ranges (for example) were
passed, or when we called 'die' without having read any state.

This patch fixes it by replacing the malloc() calls in there (all of
them, since using malloc() is almost always an error) with calloc().

malloc() either doesn't initialize the memory at all, or taints it
with a special marker so it can tell us when we're free()'ing memory
that hasn't been initialized. calloc() explicitly initializes the
allocated memory to nul bytes, which is a zero-cost operation when
we get the memory from the kernel (which alread does that) and almost
always desirable everywhere else.

Signed-off-by: Andreas Ericsson <ae@op5.se>
2012-11-02 22:25:37 -04:00
..
tests Add test file directory 2010-06-25 07:52:59 +00:00
extra_opts.c Removing CVS/SVN tags and replacing with git-based versioning 2008-11-23 05:38:47 +00:00
extra_opts.h Use a more "natural" way of writing argument lists in extra-opts tests. 2009-06-11 00:14:23 -04:00
Makefile.am Added state retention APIs. Implemented for check_snmp with --rate option. 2010-06-23 13:30:34 +00:00
parse_ini.c Return UNKNOWN if none of the default files can be found. 2009-01-22 02:24:39 -05:00
parse_ini.h Typos in comments 2008-08-21 04:17:25 +00:00
utils_base.c lib/utils_base.c: Stop dumping core on bad args to check_snmp 2012-11-02 22:25:37 -04:00
utils_base.h Added state retention APIs. Implemented for check_snmp with --rate option. 2010-06-23 13:30:34 +00:00
utils_cmd.c Fix cmd_run overwriting the environment 2010-07-02 12:55:19 -04:00
utils_cmd.h check_procs captures stderr and adds to plugin output. This is 2008-07-08 09:31:04 +00:00
utils_disk.c Fix check_disk free space calculation if blocksizes differ within a disk group (Bekar - #2973603) 2010-11-15 23:59:35 +01:00
utils_disk.h Fix check_disk free space calculation if blocksizes differ within a disk group (Bekar - #2973603) 2010-11-15 23:59:35 +01:00
utils_tcp.c Removing CVS/SVN tags and replacing with git-based versioning 2008-11-23 05:38:47 +00:00
utils_tcp.h Nothing to see here... 2007-11-09 18:24:48 +00:00