Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Free trace_id and trace_file in parse_Etag_trace.
[simgrid.git] / src / surf / surfxml_parse.c
index d529599..4912d13 100644 (file)
@@ -212,22 +212,24 @@ void STag_surfxml_platform(void)
   sscanf(A_surfxml_platform_version, "%lg", &version);
 
   xbt_assert0((version >= 1.0), "******* BIG FAT WARNING *********\n "
-              "You're using an ancient XML file. "
-              "Since SimGrid 3.1, units are Bytes, Flops, and seconds "
-              "instead of MBytes, MFlops and seconds. "
-              "A script (surfxml_update.pl) to help you convert your old "
-              "platform files "
-              "is available in the contrib/platform_generation directory "
-              "of the simgrid repository. Please check also out the "
-              "SURF section of the ChangeLog for the 3.1 version. "
-              "Last, do not forget to also update your values for "
-              "the calls to MSG_task_create (if any).");
-  xbt_assert0((version >= 2.0), "******* BIG FAT WARNING *********\n "
-              "You're using an old XML file. "
-              "A script (surfxml_update.pl) to help you convert your old "
-              "platform files "
-              "is available in the contrib/platform_generation directory "
-              "of the simgrid repository.");
+      "You're using an ancient XML file.\n"
+      "Since SimGrid 3.1, units are Bytes, Flops, and seconds "
+      "instead of MBytes, MFlops and seconds.\n"
+
+      "Use simgrid_update_xml to update your file automatically. "
+      "This program is installed automatically with SimGrid, or "
+      "available in the tools/ directory of the source archive.\n"
+
+      "Please check also out the SURF section of the ChangeLog for "
+      "the 3.1 version for more information. \n"
+
+      "Last, do not forget to also update your values for "
+      "the calls to MSG_task_create (if any).");
+  xbt_assert0((version >= 3.0), "******* BIG FAT WARNING *********\n "
+      "You're using an old XML file.\n"
+      "Use simgrid_update_xml to update your file automatically. "
+      "This program is installed automatically with SimGrid, or "
+      "available in the tools/ directory of the source archive.");
 
   surfxml_call_cb_functions(STag_surfxml_platform_cb_list);
 
@@ -428,12 +430,12 @@ void parse_properties(void)
 
 static double trace_periodicity = -1.0;
 static char *trace_file = NULL;
-static char *trace_id;
+static char *trace_id = NULL;
 
 static void parse_Stag_trace(void)
 {
-  trace_id = strdup(A_surfxml_trace_id);
-  trace_file = strdup(A_surfxml_trace_file);
+  trace_id = xbt_strdup(A_surfxml_trace_id);
+  trace_file = xbt_strdup(A_surfxml_trace_file);
   surf_parse_get_double(&trace_periodicity, A_surfxml_trace_periodicity);
 }
 
@@ -451,6 +453,10 @@ static void parse_Etag_trace(void)
                                      trace_periodicity);
   }
   xbt_dict_set(traces_set_list, trace_id, (void *) trace, NULL);
+  xbt_free(trace_file);
+  trace_file = NULL;
+  xbt_free(trace_id);
+  trace_id = NULL;
 }
 
 static void parse_Stag_trace_connect(void)