Code

Merge remote-tracking branch 'github/pr/1909' into collectd-5.5
[collectd.git] / src / aggregation.c
index 8175c66c18fb14ded8b5a4be282a9cf4e1a418c0..56e4955c247d3a4d8252d44e21b2f58d3e2be7bc 100644 (file)
@@ -262,6 +262,7 @@ static agg_instance_t *agg_instance_create (data_set_t const *ds, /* {{{ */
     inst->state_ ## field = malloc (sizeof (*inst->state_ ## field)); \
     if (inst->state_ ## field == NULL) { \
       agg_instance_destroy (inst); \
+      free (inst); \
       ERROR ("aggregation plugin: malloc() failed."); \
       return (NULL); \
     } \