}
ret_len = end - begin;
- ret = (char *) malloc (sizeof (char) * (ret_len + 1));
+ ret = malloc (ret_len + 1);
if (ret == NULL)
{
ERROR ("utils_match: match_substr: malloc failed.");
DEBUG ("utils_match: match_create_callback: regex = %s, excluderegex = %s",
regex, excluderegex);
- obj = (cu_match_t *) malloc (sizeof (cu_match_t));
+ obj = calloc (1, sizeof (*obj));
if (obj == NULL)
return (NULL);
- memset (obj, '\0', sizeof (cu_match_t));
status = regcomp (&obj->regex, regex, REG_EXTENDED | REG_NEWLINE);
if (status != 0)
cu_match_value_t *user_data;
cu_match_t *obj;
- user_data = (cu_match_value_t *) malloc (sizeof (cu_match_value_t));
+ user_data = calloc (1, sizeof (*user_data));
if (user_data == NULL)
return (NULL);
- memset (user_data, '\0', sizeof (cu_match_value_t));
user_data->ds_type = match_ds_type;
obj = match_create_callback (regex, excluderegex,