X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fdaemon%2Fmeta_data.c;h=e1d0ec5b71f17a9a284b1a37745416accece939a;hb=6a1a62048b6d0d2ddf5c17295609d3ebf010f40b;hp=6ee8446b37639dc38e479db4f6dcd48807cde725;hpb=81a5fd5046c6a39f580a8fc1a3af837fd5f5aa5c;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);