Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Allow xbt_parmap_destroy to be called with a NULL parameter
authorChristophe Thiéry <christopho128@gmail.com>
Wed, 25 Jan 2012 13:11:47 +0000 (14:11 +0100)
committerChristophe Thiéry <christopho128@gmail.com>
Wed, 25 Jan 2012 13:18:59 +0000 (14:18 +0100)
src/xbt/parmap.c

index c0ffc9f..d545b19 100644 (file)
@@ -108,6 +108,10 @@ xbt_parmap_t xbt_parmap_new(unsigned int num_workers, e_xbt_parmap_mode_t mode)
  */
 void xbt_parmap_destroy(xbt_parmap_t parmap)
 {
+  if (!parmap) {
+    return;
+  }
+
   parmap->status = XBT_PARMAP_DESTROY;
   parmap->signal_f(parmap);
   xbt_free(parmap);