diff --git a/src/daemon/meta_data.c b/src/daemon/meta_data.c
index e1d0ec5b71f17a9a284b1a37745416accece939a..cb8a195c8a29516784239b131b708a885cca5b45 100644 (file)
--- a/src/daemon/meta_data.c
+++ b/src/daemon/meta_data.c
return (NULL);
sz = strlen (orig) + 1;
return (NULL);
sz = strlen (orig) + 1;
- dest = (char *) malloc (sz);
+ dest = malloc (sz);
if (dest == NULL)
return (NULL);
if (dest == NULL)
return (NULL);
{
meta_entry_t *e;
{
meta_entry_t *e;
- e = (meta_entry_t *) malloc (sizeof (*e));
+ e = calloc (1, sizeof (*e));
if (e == NULL)
{
if (e == NULL)
{
- ERROR ("md_entry_alloc: malloc failed.");
+ ERROR ("md_entry_alloc: calloc failed.");
return (NULL);
}
return (NULL);
}
- memset (e, 0, sizeof (*e));
e->key = md_strdup (key);
if (e->key == NULL)
e->key = md_strdup (key);
if (e->key == NULL)
{
meta_data_t *md;
{
meta_data_t *md;
- md = (meta_data_t *) malloc (sizeof (*md));
+ md = calloc (1, sizeof (*md));
if (md == NULL)
{
if (md == NULL)
{
- ERROR ("meta_data_create: malloc failed.");
+ ERROR ("meta_data_create: calloc failed.");
return (NULL);
}
return (NULL);
}
- memset (md, 0, sizeof (*md));
- md->head = NULL;
pthread_mutex_init (&md->lock, /* attr = */ NULL);
return (md);
pthread_mutex_init (&md->lock, /* attr = */ NULL);
return (md);