diff --git a/lib/parse_ini.c b/lib/parse_ini.c index 450100ad..e448bf1a 100644 --- a/lib/parse_ini.c +++ b/lib/parse_ini.c @@ -118,7 +118,7 @@ static void parse_locator(const char *locator, const char *def_stanza, np_ini_in np_arg_list* np_get_defaults(const char *locator, const char *default_section){ FILE *inifile=NULL; np_arg_list *defaults=NULL; - np_ini_info i; + np_ini_info i = {NULL, NULL}; struct stat fstat; bool is_suid_set = np_suid(); diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index 4caa879b..c0c32f09 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c @@ -970,12 +970,12 @@ static void run_checks() { /* icmp header : 28 bytes */ /* icmp echo reply : the rest */ static int wait_for_reply(int sock, u_int t) { - int n, hlen; + int n, hlen = 0; static unsigned char buf[4096]; struct sockaddr_storage resp_addr; union ip_hdr *ip; union icmp_packet packet; - struct rta_host *host; + struct rta_host *host = NULL; struct icmp_ping_data data; struct timeval wait_start, now; u_int tdiff, i, per_pkt_wait; @@ -1698,8 +1698,8 @@ static u_int get_timevaldiff(struct timeval *early, struct timeval *later) { static int add_target_ip(char *arg, struct sockaddr_storage *in) { struct rta_host *host; - struct sockaddr_in *sin, *host_sin; - struct sockaddr_in6 *sin6, *host_sin6; + struct sockaddr_in *sin = NULL, *host_sin; + struct sockaddr_in6 *sin6 = NULL, *host_sin6; if (address_family == AF_INET) { sin = (struct sockaddr_in *)in; diff --git a/plugins/check_disk.c b/plugins/check_disk.c index c882554d..779cce71 100755 --- a/plugins/check_disk.c +++ b/plugins/check_disk.c @@ -233,7 +233,7 @@ main (int argc, char **argv) int temp_result2; struct mount_entry *me; - struct mount_entry *last_me; + struct mount_entry *last_me = NULL; struct fs_usage fsp, tmpfsp; struct parameter_list *temp_list, *path; diff --git a/plugins/check_load.c b/plugins/check_load.c index de0fe669..b5a2f97c 100644 --- a/plugins/check_load.c +++ b/plugins/check_load.c @@ -101,7 +101,7 @@ get_threshold(char *arg, double *th) int main (int argc, char **argv) { - int result; + int result = 0; int i, j; long numcpus; @@ -356,7 +356,7 @@ int cmpstringp(const void *p1, const void *p2) { #ifdef PS_USES_PROCETIME char procetime[MAX_INPUT_BUFFER] = { '\0' }; #endif /* PS_USES_PROCETIME */ - char *procprog; + char *procprog = NULL; char *proc_cgroup_hierarchy; int pos; sscanf (* (char * const *) p1, PS_FORMAT, PS_VARLIST); diff --git a/plugins/check_ntp_peer.c b/plugins/check_ntp_peer.c index 787b1991..0b15e7a3 100644 --- a/plugins/check_ntp_peer.c +++ b/plugins/check_ntp_peer.c @@ -560,7 +560,8 @@ char *perfd_truechimers (int num_truechimers) } int main(int argc, char *argv[]){ - int result, offset_result, stratum, num_truechimers, oresult, jresult, sresult, tresult; + int result, offset_result, stratum, num_truechimers, oresult; + int jresult = STATE_OK, sresult = STATE_OK, tresult = STATE_OK; double offset=0, jitter=0; char *result_line, *perfdata_line;