Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix memory leak.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 5 Feb 2013 20:49:36 +0000 (21:49 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 6 Feb 2013 10:00:52 +0000 (11:00 +0100)
include/msg/datatypes.h
src/msg/msg_vm.c

index 9489308..46281fe 100644 (file)
@@ -89,7 +89,7 @@ typedef enum {
 } e_msg_vm_state_t;
 
 typedef struct msg_vm {
 } e_msg_vm_state_t;
 
 typedef struct msg_vm {
-  const char *name;
+  char *name;
   s_xbt_swag_hookup_t all_vms_hookup;
   s_xbt_swag_hookup_t host_vms_hookup;
   xbt_dynar_t processes;
   s_xbt_swag_hookup_t all_vms_hookup;
   s_xbt_swag_hookup_t host_vms_hookup;
   xbt_dynar_t processes;
index c025372..473d8e2 100644 (file)
@@ -220,7 +220,7 @@ void MSG_vm_destroy(msg_vm_t vm) {
   TRACE_msg_vm_end(vm);
   #endif
 
   TRACE_msg_vm_end(vm);
   #endif
 
-
+  xbt_free(vm->name);
   xbt_dynar_free(&vm->processes);
   xbt_free(vm);
 }
   xbt_dynar_free(&vm->processes);
   xbt_free(vm);
 }