OpenSM/osm_ucast_updn.c: Handle failed memory allocation

Signed-off-by: Hal Rosenstock <[EMAIL PROTECTED]>

diff --git a/osm/opensm/osm_ucast_updn.c b/osm/opensm/osm_ucast_updn.c
index 7fa119e..3d96478 100644
--- a/osm/opensm/osm_ucast_updn.c
+++ b/osm/opensm/osm_ucast_updn.c
@@ -628,6 +628,11 @@ updn_init(
         if (strlen(line) > 1)
         {
           p_tmp = malloc(sizeof(uint64_t));
+          if (!p_tmp)
+          {
+            status = IB_ERROR;
+            goto Exit;
+          }
           *p_tmp = strtoull(line, NULL, 16);
           cl_list_insert_tail(p_updn->p_root_nodes, p_tmp);
         }




_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to