X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Fltt%2Ffacility.c;h=13781668ad00482d16ee754ca3f5eb97286ac3df;hb=cf1307afdbc277b663c03f79deb818cf270536b0;hp=1c31f0198fad625bde8703c808cbb422283f9672;hpb=963b5f2df23dc1c70bdc70d4aecb76f50651997b;p=lttv.git diff --git a/ltt/branches/poly/ltt/facility.c b/ltt/branches/poly/ltt/facility.c index 1c31f019..13781668 100644 --- a/ltt/branches/poly/ltt/facility.c +++ b/ltt/branches/poly/ltt/facility.c @@ -89,7 +89,7 @@ void ltt_facility_open(LttTrace * t, char * pathname) table_dispose(&fac->named_types); freeTypes(&fac->unnamed_types); sequence_dispose(&fac->unnamed_types); - free(fac); + g_free(fac); } else in.error(&in,"facility token was expected"); } @@ -139,22 +139,28 @@ void generateFacility(LttFacility *f, facility *fac,LttChecksum checksum) evType->facility = f; evType->index = i; - field->field_pos = 0; - type = lookup_named_type(f,((event*)(events->array[i]))->type); - field->field_type = type; - field->offset_root = 0; - field->fixed_root = 1; - field->offset_parent = 0; - field->fixed_parent = 1; - // field->base_address = NULL; - field->field_size = 0; - field->field_fixed = -1; - field->parent = NULL; - field->child = NULL; - field->current_element = 0; - - //construct field tree and type graph - constructTypeAndFields(f,((event*)(events->array[i]))->type,field); + if(((event*)(events->array[i]))->type != NULL){ + field->field_pos = 0; + type = lookup_named_type(f,((event*)(events->array[i]))->type); + field->field_type = type; + field->offset_root = 0; + field->fixed_root = 1; + field->offset_parent = 0; + field->fixed_parent = 1; + // field->base_address = NULL; + field->field_size = 0; + field->field_fixed = -1; + field->parent = NULL; + field->child = NULL; + field->current_element = 0; + + //construct field tree and type graph + constructTypeAndFields(f,((event*)(events->array[i]))->type,field); + }else{ + evType->root_field = NULL; + sequence_pop(&(f->all_fields)); + g_free(field); + } } }