@@ -858,6 +858,10 @@ static void _toolconn(int sd, short args, void *cbdata)
858
858
} else if (0 == strcmp (val -> key , OPAL_PMIX_RANK )) {
859
859
tool .vpid = val -> data .name .vpid ;
860
860
} else if (0 == strcmp (val -> key , OPAL_PMIX_HOSTNAME )) {
861
+ if (NULL != hostname ) {
862
+ /* shouldn't happen, but just take the last one */
863
+ free (hostname );
864
+ }
861
865
hostname = strdup (val -> data .string );
862
866
}
863
867
}
@@ -880,6 +884,9 @@ static void _toolconn(int sd, short args, void *cbdata)
880
884
cd -> toolcbfunc (ORTE_ERROR , tool , cd -> cbdata );
881
885
}
882
886
OBJ_RELEASE (cd );
887
+ if (NULL != hostname ) {
888
+ free (hostname );
889
+ }
883
890
return ;
884
891
}
885
892
tool .jobid = jdata -> jobid ;
@@ -891,6 +898,9 @@ static void _toolconn(int sd, short args, void *cbdata)
891
898
cd -> toolcbfunc (ORTE_ERR_NOT_SUPPORTED , tool , cd -> cbdata );
892
899
}
893
900
OBJ_RELEASE (cd );
901
+ if (NULL != hostname ) {
902
+ free (hostname );
903
+ }
894
904
return ;
895
905
}
896
906
} else {
@@ -956,6 +966,7 @@ static void _toolconn(int sd, short args, void *cbdata)
956
966
ORTE_FLAG_SET (node , ORTE_NODE_NON_USABLE );
957
967
opal_pointer_array_add (orte_node_pool , node );
958
968
}
969
+ free (hostname ); // no longer needed
959
970
}
960
971
proc -> node = node ;
961
972
OBJ_RETAIN (node ); /* keep accounting straight */
0 commit comments