Index: trunk/zoo-kernel/service_conf.y
===================================================================
--- trunk/zoo-kernel/service_conf.y	(revision 20)
+++ trunk/zoo-kernel/service_conf.y	(revision 57)
@@ -133,5 +133,4 @@
  : STag contentetoile ETag	
 {
-  free($3);
 }
 
@@ -210,6 +209,7 @@
 	  my_service->inputs->next=NULL;
 	}
-	else
+	else if(current_element!=NULL && current_element->name!=NULL){
 	  addToElements(&my_service->inputs,current_element);
+	}
 #ifdef DEBUG_SERVICE_CONF
 	fprintf(stderr,"CURRENT_ELEMENT\n");
@@ -267,5 +267,5 @@
 	      addMapToMap(&current_element->metadata,current_content);
 	      current_element->next=NULL;
-	      current_element->format=$2;
+	      current_element->format=strdup($2);
 	      current_element->defaults=NULL;
 	      current_element->supported=NULL;
@@ -280,5 +280,5 @@
 	    current_element->metadata=NULL;
 	    current_element->next=NULL;
-	    current_element->format=$2;
+	    current_element->format=strdup($2);
 	    current_element->defaults=NULL;
 	    current_element->supported=NULL;
@@ -297,6 +297,6 @@
 	      if(wait_defaults==true){
 		defaultsc++;
-		freeMap(&current_content);
-		current_content=NULL;
+		/*freeMap(&current_content);
+		  current_content=NULL;*/
 	      }
 	      current_data=5;
@@ -305,7 +305,4 @@
   printf("* Identifiant : %s\n",$2);
 #endif
-  /* et on renvoie l'identifiant de balise afin de pouvoir le comparer */
-  /* avec la balise jumelle fermante ! */
-  $$ = $2 ;
 }
  ;
@@ -338,5 +335,4 @@
   printf ("attribute : %s\n",$1) ;
 #endif
-  free($1);
 }
  ;
@@ -391,44 +387,32 @@
     current_content=NULL;
     current_element->supported=NULL;
+    current_element->next=NULL;
   }
   if(strcmp($3,"Supported")==0){
     current_data=previous_data;
     if(current_element->supported==NULL){
-      //addMapToIoType(&current_element->supported,current_content);
-      current_element->supported=(iotype*)malloc(IOTYPE_SIZE);
-      current_element->supported->content=NULL;
-      addMapToMap(&current_element->supported->content,current_content);
-      freeMap(&current_content);
-      free(current_content);
-      current_element->supported->next=NULL;
-      current_content=NULL;
+      if(current_content!=NULL){
+	current_element->supported=(iotype*)malloc(IOTYPE_SIZE);
+	current_element->supported->content=NULL;
+	addMapToMap(&current_element->supported->content,current_content);
+	freeMap(&current_content);
+	free(current_content);
+	current_element->supported->next=NULL;
+	current_content=NULL;
+      }else{
+	current_element->supported=NULL;
+	current_element->next=NULL;
+      }
     }
     else{
-#ifdef DEBUG
-      // Currently we support only one supported format
+#ifdef DEBUG_SERVICE_CONF
       fprintf(stderr,"SECOND SUPPORTED FORMAT !!!!\n");
 #endif
-      //addMapToIoType(&current_element->supported,current_content);
-      /*iotype* iotmp=*(&current_element->supported);
-      while(iotmp!=NULL){
-	dumpMap(iotmp->content);
-	iotmp=iotmp->next;
-      }
-      iotmp=(iotype*)malloc(IOTYPE_SIZE);
-      iotmp->content=NULL;
-      addMapToMap(&iotmp->content,current_content);
-      iotmp->next=NULL;
-      dumpElements(current_element);
-      fprintf(stderr,"SECOND SUPPORTED FORMAT MAP START !!!!\n");
-      dumpMap(current_content);
-      fprintf(stderr,"SECOND SUPPORTED FORMAT MAP END !!!!\n");*/
+      addMapToIoType(&current_element->supported,current_content);
       freeMap(&current_content);
       free(current_content);
       current_content=NULL;
-      /*freeMap(&iotmp->content);
-      free(&iotmp->content);
-      free(iotype);*/
-#ifdef DEBUG
-      // Currently we support only one supported format
+#ifdef DEBUG_SERVICE_CONF
+      dumpElements(current_element);
       fprintf(stderr,"SECOND SUPPORTED FORMAT !!!!\n");
 #endif
@@ -436,7 +420,4 @@
     current_content=NULL;
   }
-  /* on renvoie l'identifiant de la balise pour pouvoir comparer les 2 */
-  /* /!\ une balise fermante n'a pas d'attributs (c.f. : W3C) */
-  $$ = $3;
 }
  ;
@@ -610,6 +591,5 @@
       if(current_data==2){ 
 	if(wait_inputs==true){
-	  fprintf(stderr,"dup INPUTS\n");
-	  if(current_element->name!=NULL){
+	  if(current_element!=NULL && current_element->name!=NULL){
 	    if(my_service->inputs==NULL){
 	      my_service->inputs=dupElements(current_element);
@@ -661,5 +641,4 @@
 	  }
 	  wait_inputs=false;
-	  dumpMap(current_content);
 	  current_content=NULL;
 	}
@@ -755,5 +734,5 @@
   int resultatYYParse = srparse() ;
   
-  if(wait_outputs==true && current_element->name!=NULL){
+  if(wait_outputs==true && current_element!=NULL && current_element->name!=NULL){
     if(my_service->outputs==NULL){      
 #ifdef DEBUG_SERVICE_CONF
@@ -762,7 +741,4 @@
       my_service->outputs=dupElements(current_element);
       my_service->outputs->next=NULL;
-      freeElements(&current_element);
-      free(current_element);
-      current_element=NULL;
     }
     else{
@@ -778,8 +754,10 @@
     free(current_element);
     current_element=NULL;
+#ifdef DEBUG_SERVICE_CONF
+    fprintf(stderr,"(DATAOUTPUTS - 631) FREE current_element\n");
+#endif
   }
   if(current_element!=NULL){
     freeElements(&current_element);
-    fprintf(stderr,"LINE 709");
     free(current_element);
     current_element=NULL;
@@ -787,5 +765,4 @@
   if(current_content!=NULL){
     freeMap(&current_content);
-    fprintf(stderr,"LINE 715");
     free(current_content);
     current_content=NULL;
