Open MPI logo

PLPA Users' Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all PLPA Users mailing list

Subject: [PLPA users] missing clear_cache() in error path
From: Bert Wesarg (bert.wesarg_at_[hidden])
Date: 2008-03-14 11:42:48


There is a missing clear_cache() in case a malloc() failed in load_cache().

Bye
Bert

---
diff --git a/src/libplpa/plpa_map.c b/src/libplpa/plpa_map.c
index 1681640..9551e4a 100644
--- a/src/libplpa/plpa_map.c
+++ b/src/libplpa/plpa_map.c
@@ -204,6 +204,7 @@ static void load_cache(const char *sysfs_mount)
     map_processor_id_to_tuple = malloc(sizeof(tuple_t) *
                                        (max_processor_num + 2));
     if (NULL == map_processor_id_to_tuple) {
+        clear_cache();
         return;
     }
     for (i = 0; i <= max_processor_num; ++i) {