meta_data.c: check return value of md_entry_alloc
[collectd.git] / src / meta_data.c
index b6483e8..0fc58ff 100644 (file)
@@ -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);