diff --git a/src/modbus.c b/src/modbus.c
index d538fb3f717774bbc36b6c2eb7b7e1ff0919bc85..2605ec239182bf17315aa1563f38284d680fb13e 100644 (file)
--- a/src/modbus.c
+++ b/src/modbus.c
int status;
int i;
int status;
int i;
- host = malloc (sizeof (*host));
+ host = calloc (1, sizeof (*host));
if (host == NULL)
return (ENOMEM);
if (host == NULL)
return (ENOMEM);
- memset (host, 0, sizeof (*host));
host->slaves = NULL;
status = cf_util_get_string_buffer (ci, host->host, sizeof (host->host));
host->slaves = NULL;
status = cf_util_get_string_buffer (ci, host->host, sizeof (host->host));