Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[xbt] Fix a another memory leak in the promela parser
authorGabriel Corona <gabriel.corona@loria.fr>
Wed, 23 Mar 2016 09:27:28 +0000 (10:27 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Wed, 23 Mar 2016 10:19:04 +0000 (11:19 +0100)
src/xbt/automaton/automatonparse_promela.c

index 64d5813..3640482 100644 (file)
@@ -47,12 +47,11 @@ static void new_state(char* id, int src){
     
 }
 
     
 }
 
-static void new_transition(char* id, xbt_automaton_exp_label_t label){
-
-  char* id_state = xbt_strdup(id);
+static void new_transition(char* id, xbt_automaton_exp_label_t label)
+{
   xbt_automaton_state_t state_dst = NULL;
   new_state(id, 0);
   xbt_automaton_state_t state_dst = NULL;
   new_state(id, 0);
-  state_dst = xbt_automaton_state_exists(parsed_automaton, id_state);
+  state_dst = xbt_automaton_state_exists(parsed_automaton, id);
   xbt_automaton_state_t state_src = xbt_automaton_state_exists(parsed_automaton, state_id_src);
   
   //xbt_transition_t trans = NULL;
   xbt_automaton_state_t state_src = xbt_automaton_state_exists(parsed_automaton, state_id_src);
   
   //xbt_transition_t trans = NULL;