static int memcached_connect_inet (memcached_t *st)
{
- char *host;
- char *port;
+ const char *host;
+ const char *port;
struct addrinfo ai_hints;
struct addrinfo *ai_list, *ai_ptr;
}
else if (FIELD_IS ("listen_disabled_num"))
{
- submit_derive ("memcached_connections", "listen_disabled", atof (fields[2]), st);
+ submit_derive ("connections", "listen_disabled", atof (fields[2]), st);
}
/*
/* 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;