summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a0bcba7)
raw | patch | inline | side by side (parent: a0bcba7)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 1 Apr 2016 15:11:17 +0000 (17:11 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 1 Apr 2016 15:11:17 +0000 (17:11 +0200) |
src/memcached.c | patch | blob | history |
diff --git a/src/memcached.c b/src/memcached.c
index 2c01a576566579e32b3d8b092bebb4f1fdc5bc5f..4e7b1431ba43a23785b1699e8717c822d959f8f3 100644 (file)
--- a/src/memcached.c
+++ b/src/memcached.c
/* 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;