Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[xbt] Fix yet another memory leak in the promela parser
authorGabriel Corona <gabriel.corona@loria.fr>
Wed, 23 Mar 2016 09:29:01 +0000 (10:29 +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 3640482..b86bf6e 100644 (file)
@@ -42,9 +42,11 @@ static void new_state(char* id, int src){
   if(type==-1)
     parsed_automaton->current_state = state;
 
-  if(src)
+  if(src) {
+    if (state_id_src)
+      free(state_id_src);
     state_id_src = xbt_strdup(id);
-    
+  }
 }
 
 static void new_transition(char* id, xbt_automaton_exp_label_t label)