@@ -427,7 +427,6 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
427427 nspace = NULL ;
428428 rc = parse_uri_file (& suri [5 ], & suri2 , & nspace , & rank );
429429 if (PMIX_SUCCESS != rc ) {
430- free (suri );
431430 rc = PMIX_ERR_UNREACH ;
432431 goto cleanup ;
433432 }
@@ -437,7 +436,6 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
437436 /* we need to extract the nspace/rank of the server from the string */
438437 p = strchr (suri , ';' );
439438 if (NULL == p ) {
440- free (suri );
441439 rc = PMIX_ERR_BAD_PARAM ;
442440 goto cleanup ;
443441 }
@@ -449,7 +447,6 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
449447 p = strchr (suri , '.' );
450448 if (NULL == p ) {
451449 free (suri2 );
452- free (suri );
453450 rc = PMIX_ERR_BAD_PARAM ;
454451 goto cleanup ;
455452 }
@@ -465,9 +462,6 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
465462 "ptl:tcp:tool attempt connect using given URI %s" , suri );
466463 /* go ahead and try to connect */
467464 if (PMIX_SUCCESS != (rc = try_connect (suri , & sd , iptr , niptr ))) {
468- if (NULL != nspace ) {
469- free (nspace );
470- }
471465 goto cleanup ;
472466 }
473467 /* cleanup */
@@ -486,9 +480,6 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
486480 /* go ahead and try to connect */
487481 if (PMIX_SUCCESS == try_connect (suri , & sd , iptr , niptr )) {
488482 /* don't free nspace - we will use it below */
489- if (NULL != rendfile ) {
490- free (rendfile );
491- }
492483 if (NULL != iptr ) {
493484 PMIX_INFO_FREE (iptr , niptr );
494485 }
@@ -522,6 +513,7 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
522513 goto complete ;
523514 }
524515 free (nspace );
516+ nspace = NULL ;
525517 }
526518 }
527519
@@ -683,7 +675,6 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
683675 }
684676 if (NULL != server_nspace ) {
685677 free (server_nspace );
686- server_nspace = NULL ;
687678 }
688679 return rc ;
689680}
0 commit comments