return (NULL);
sz = strlen (orig) + 1;
- dest = (char *) malloc (sz);
+ dest = malloc (sz);
if (dest == NULL)
return (NULL);
return (-1);
}
- act = (tr_action_t *) malloc (sizeof (*act));
+ act = calloc (1, sizeof (*act));
if (act == NULL)
{
- ERROR ("tr_config_add_action: malloc failed.");
+ ERROR ("tr_config_add_action: calloc failed.");
return (-ENOMEM);
}
- memset (act, 0, sizeof (*act));
act->replacement = NULL;
act->may_be_empty = may_be_empty;
tr_action_t *act;
int status;
char buffer[DATA_MAX_NAME_LEN];
- regmatch_t matches[8];
+ regmatch_t matches[8] = { [0] = { 0 } };
if (act_head == NULL)
return (-EINVAL);
sstrncpy (buffer, buffer_in, sizeof (buffer));
- memset (matches, 0, sizeof (matches));
DEBUG ("target_replace plugin: tr_action_invoke: <- buffer = %s;", buffer);
int status;
int i;
- data = (tr_data_t *) malloc (sizeof (*data));
+ data = calloc (1, sizeof (*data));
if (data == NULL)
{
- ERROR ("tr_create: malloc failed.");
+ ERROR ("tr_create: calloc failed.");
return (-ENOMEM);
}
- memset (data, 0, sizeof (*data));
data->host = NULL;
data->plugin = NULL;
void module_register (void)
{
- target_proc_t tproc;
+ target_proc_t tproc = { 0 };
- memset (&tproc, 0, sizeof (tproc));
tproc.create = tr_create;
tproc.destroy = tr_destroy;
tproc.invoke = tr_invoke;