Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Bug fix and add a xbt_swag_foreach_safe where you can remove objects from
[simgrid.git] / src / xbt / swag.c
index dc09977..42e70fd 100644 (file)
@@ -57,7 +57,7 @@ void *xbt_swag_extract(void *obj, xbt_swag_t swag)
 {
   size_t offset = swag->offset;
 
-  if (!obj)
+  if ((!obj) || (!swag))
     return NULL;
   if(!xbt_swag_belongs(obj, swag)) /* Trying to remove an object that
                                      was not in this swag */