X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdaemon%2Fmeta_data.c;h=e1d0ec5b71f17a9a284b1a37745416accece939a;hb=5c2993e4121feae745551be182221b31bc23ff97;hp=d3da9bb5800bc776c1b509c31a6f0225300661c4;hpb=6299d39b903cb87a3db5b6d2148a2d717754a30a;p=collectd.git diff --git a/src/daemon/meta_data.c b/src/daemon/meta_data.c index d3da9bb5..e1d0ec5b 100644 --- a/src/daemon/meta_data.c +++ b/src/daemon/meta_data.c @@ -114,6 +114,8 @@ static meta_entry_t *md_entry_clone (const meta_entry_t *orig) /* {{{ */ return (NULL); copy = md_entry_alloc (orig->key); + if (copy == NULL) + return (NULL); copy->type = orig->type; if (copy->type == MD_TYPE_STRING) copy->value.mv_string = strdup (orig->value.mv_string); @@ -255,7 +257,6 @@ void meta_data_destroy (meta_data_t *md) /* {{{ */ if (md == NULL) return; - pthread_mutex_destroy(&md->lock); md_entry_free (md->head); pthread_mutex_destroy (&md->lock); free (md); @@ -494,7 +495,7 @@ int meta_data_get_string (meta_data_t *md, /* {{{ */ if (e->type != MD_TYPE_STRING) { - ERROR ("meta_data_get_signed_int: Type mismatch for key `%s'", e->key); + ERROR ("meta_data_get_string: Type mismatch for key `%s'", e->key); pthread_mutex_unlock (&md->lock); return (-ENOENT); }