X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fmeta_data.c;h=0fc58ff5c021e784a3bcc0feb902ab634db040f6;hb=f0b9430b0c0f45ada6f655dd4b9c64a8cbdf8d66;hp=48dcabcec884d8bed391ece4eb184ee3aed9f700;hpb=9708614487ec93df67ad1095f3cf5a0987b9cc28;p=collectd.git diff --git a/src/meta_data.c b/src/meta_data.c index 48dcabce..0fc58ff5 100644 --- a/src/meta_data.c +++ b/src/meta_data.c @@ -109,6 +109,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); @@ -250,7 +252,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);