X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Ftarget_notification.c;h=55b72ac1acf330f15ea8899aa8181ca134a64bd3;hb=354f9991530248e45207d236eb74c1cc3d5238ef;hp=14fb5418addc659a5c429c03160ff3ef8e84871a;hpb=28fa063b625c772f45c99b618f498715fb98474b;p=collectd.git diff --git a/src/target_notification.c b/src/target_notification.c index 14fb5418..55b72ac1 100644 --- a/src/target_notification.c +++ b/src/target_notification.c @@ -126,13 +126,12 @@ static int tn_create (const oconfig_item_t *ci, void **user_data) /* {{{ */ int status; int i; - data = (tn_data_t *) malloc (sizeof (*data)); + data = calloc (1, sizeof (*data)); if (data == NULL) { - ERROR ("tn_create: malloc failed."); + ERROR ("tn_create: calloc failed."); return (-ENOMEM); } - memset (data, 0, sizeof (*data)); data->message = NULL; data->severity = 0;