From: Kevin Bowling Date: Wed, 6 Apr 2016 06:20:48 +0000 (-0700) Subject: Merge branch 'ym/target_set_add_meta' of github.com:ymettier/collectd into target_set... X-Git-Tag: collectd-5.6.0~359^2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e030096e4f5a0bbdd42635bfeb95e39d150cac72;p=collectd.git Merge branch 'ym/target_set_add_meta' of github.com:ymettier/collectd into target_set_add_meta --- e030096e4f5a0bbdd42635bfeb95e39d150cac72 diff --cc src/daemon/meta_data.c index f87e35e4,8ddd4780..03b1d263 --- a/src/daemon/meta_data.c +++ b/src/daemon/meta_data.c @@@ -109,12 -111,12 +110,14 @@@ static meta_entry_t *md_entry_clone_con { meta_entry_t *copy; - if (orig == NULL) - return (NULL); + /* WARNINGS : + * - we do not check that orig != NULL here. You should have done it before. + * - we do not set copy->next. DO NOT FORGET TO SET copy->next IN YOUR FUNCTION + */ 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);