Exemplo n.º 1
0
static void tcsv_instance_definition_destroy(void *arg){
    instance_definition_t *id;

    id = arg;
    if (id == NULL)
        return;

    if (id->tail != NULL)
        cu_tail_destroy (id->tail);
    id->tail = NULL;

    sfree(id->instance);
    sfree(id->path);
    sfree(id->metric_list);
    sfree(id);
}
Exemplo n.º 2
0
void tail_match_destroy(cu_tail_match_t *obj) {
  if (obj == NULL)
    return;

  if (obj->tail != NULL) {
    cu_tail_destroy(obj->tail);
    obj->tail = NULL;
  }

  for (size_t i = 0; i < obj->matches_num; i++) {
    cu_tail_match_match_t *match = obj->matches + i;
    if (match->match != NULL) {
      match_destroy(match->match);
      match->match = NULL;
    }

    if ((match->user_data != NULL) && (match->free != NULL))
      (*match->free)(match->user_data);
    match->user_data = NULL;
  }

  sfree(obj->matches);
  sfree(obj);
} /* void tail_match_destroy */