Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
plug some memleaks
[simgrid.git] / src / gras / Msg / gras_msg_types.c
index 0622109..374b3fe 100644 (file)
@@ -79,8 +79,10 @@ gras_msgtype_declare_ext(const char           *name,
     msgtype = (gras_msgtype_t)xbt_set_get_by_name(_gras_msgtype_set,namev);
     found = 1;
   } CATCH(e) {
-    if (e.category != not_found_error)
+    if (e.category != not_found_error) {
+      xbt_free(namev);
       RETHROW;
+    }
     xbt_ex_free(e);
   }
 
@@ -100,6 +102,7 @@ gras_msgtype_declare_ext(const char           *name,
                 namev,gras_datadesc_get_name(payload_answer),
                 gras_datadesc_get_name(msgtype->answer_type));
 
+    xbt_free(namev);
     return ; /* do really ignore it */
   }
 
@@ -225,7 +228,7 @@ gras_cb_register_(gras_msgtype_t msgtype,
   gras_msg_procdata_t pd=
     (gras_msg_procdata_t)gras_libdata_by_id(gras_msg_libdata_id);
   gras_cblist_t *list=NULL;
-  int cpt;
+  unsigned int cpt;
 
   DEBUG2("Register %p as callback to '%s'",cb,msgtype->name);
 
@@ -258,7 +261,7 @@ gras_cb_unregister_(gras_msgtype_t msgtype,
     (gras_msg_procdata_t)gras_libdata_by_id(gras_msg_libdata_id);
   gras_cblist_t *list;
   gras_msg_cb_t cb_cpt;
-  int cpt;
+  unsigned int cpt;
   int found = 0;
 
   /* search the list of cb for this message on this host */