/* Disable automatic generation of default instance in the init callback. */
memcached_have_instances = 1;
- st = malloc (sizeof (*st));
+ st = calloc (1, sizeof (*st));
if (st == NULL)
{
- ERROR ("memcached plugin: malloc failed.");
+ ERROR ("memcached plugin: calloc failed.");
return (-1);
}
- memset (st, 0, sizeof (*st));
st->name = NULL;
st->socket = NULL;
st->host = NULL;
return (0);
/* No instances were configured, lets start a default instance. */
- st = malloc (sizeof (*st));
+ st = calloc (1, sizeof (*st));
if (st == NULL)
return (ENOMEM);
- memset (st, 0, sizeof (*st));
st->name = sstrdup ("__legacy__");
st->socket = NULL;
st->host = NULL;