X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdaemon%2Fmeta_data.c;h=e1d0ec5b71f17a9a284b1a37745416accece939a;hb=9b1ae7f672fd2712b452a58e0682cdea2e34c0f8;hp=6ee8446b37639dc38e479db4f6dcd48807cde725;hpb=24c2f247f6dc5c17b26d715346a380efababb08f;p=collectd.git diff --git a/src/daemon/meta_data.c b/src/daemon/meta_data.c index 6ee8446b..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);