First part of memory leak cleanups from Gilles
Этот коммит содержится в:
родитель
ee3d1ed5fd
Коммит
48f702827e
@ -584,6 +584,9 @@ static int connect_accept(ompi_communicator_t *comm, int root,
|
|||||||
if ( NULL != proc_list ) {
|
if ( NULL != proc_list ) {
|
||||||
free ( proc_list );
|
free ( proc_list );
|
||||||
}
|
}
|
||||||
|
if ( NULL != new_proc_list ) {
|
||||||
|
free ( new_proc_list );
|
||||||
|
}
|
||||||
if ( OMPI_SUCCESS != rc ) {
|
if ( OMPI_SUCCESS != rc ) {
|
||||||
if ( MPI_COMM_NULL != newcomp && NULL != newcomp ) {
|
if ( MPI_COMM_NULL != newcomp && NULL != newcomp ) {
|
||||||
OBJ_RETAIN(newcomp);
|
OBJ_RETAIN(newcomp);
|
||||||
|
@ -312,13 +312,14 @@ static void xcast_recv(int status, orte_process_name_t* sender,
|
|||||||
rly = OBJ_NEW(opal_buffer_t);
|
rly = OBJ_NEW(opal_buffer_t);
|
||||||
opal_dss.copy_payload(rly, buffer);
|
opal_dss.copy_payload(rly, buffer);
|
||||||
|
|
||||||
/* get the signature */
|
/* get the signature that we do not need */
|
||||||
cnt=1;
|
cnt=1;
|
||||||
if (ORTE_SUCCESS != (ret = opal_dss.unpack(buffer, &sig, &cnt, ORTE_SIGNATURE))) {
|
if (ORTE_SUCCESS != (ret = opal_dss.unpack(buffer, &sig, &cnt, ORTE_SIGNATURE))) {
|
||||||
ORTE_ERROR_LOG(ret);
|
ORTE_ERROR_LOG(ret);
|
||||||
ORTE_FORCED_TERMINATE(ret);
|
ORTE_FORCED_TERMINATE(ret);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
OBJ_RELEASE(sig);
|
||||||
|
|
||||||
/* get the target tag */
|
/* get the target tag */
|
||||||
cnt=1;
|
cnt=1;
|
||||||
|
@ -15,6 +15,8 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2011-2013 Cisco Systems, Inc. All rights reserved.
|
* Copyright (c) 2011-2013 Cisco Systems, Inc. All rights reserved.
|
||||||
* Copyright (c) 2013-2014 Intel, Inc. All rights reserved.
|
* Copyright (c) 2013-2014 Intel, Inc. All rights reserved.
|
||||||
|
* Copyright (c) 2014 Research Organization for Information Science
|
||||||
|
* and Technology (RIST). All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -393,7 +395,16 @@ static int odls_base_default_setup_fork(orte_job_t *jdata,
|
|||||||
/* setup base environment: copy the current environ and merge
|
/* setup base environment: copy the current environ and merge
|
||||||
in the app context environ */
|
in the app context environ */
|
||||||
if (NULL != context->env) {
|
if (NULL != context->env) {
|
||||||
|
if (*environ_copy == context->env) {
|
||||||
|
/* manually free original context->env to avoid a memory leak */
|
||||||
|
char ** tmp = context->env;
|
||||||
*environ_copy = opal_environ_merge(orte_launch_environ, context->env);
|
*environ_copy = opal_environ_merge(orte_launch_environ, context->env);
|
||||||
|
if (NULL != tmp) {
|
||||||
|
opal_argv_free(tmp);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
*environ_copy = opal_environ_merge(orte_launch_environ, context->env);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
*environ_copy = opal_argv_copy(orte_launch_environ);
|
*environ_copy = opal_argv_copy(orte_launch_environ);
|
||||||
}
|
}
|
||||||
@ -891,8 +902,8 @@ void orte_odls_base_default_launch_local(int fd, short sd, void *cbdata)
|
|||||||
orte_jobid_t job = caddy->job;
|
orte_jobid_t job = caddy->job;
|
||||||
orte_odls_base_fork_local_proc_fn_t fork_local = caddy->fork_local;
|
orte_odls_base_fork_local_proc_fn_t fork_local = caddy->fork_local;
|
||||||
char *num_app_ctx = NULL;
|
char *num_app_ctx = NULL;
|
||||||
char **nps, *npstring;
|
char **nps, *npstring = NULL;
|
||||||
char **firstranks, *firstrankstring;
|
char **firstranks, *firstrankstring = NULL;
|
||||||
bool index_argv;
|
bool index_argv;
|
||||||
|
|
||||||
/* establish our baseline working directory - we will be potentially
|
/* establish our baseline working directory - we will be potentially
|
||||||
@ -1385,6 +1396,16 @@ void orte_odls_base_default_launch_local(int fd, short sd, void *cbdata)
|
|||||||
ERROR_OUT:
|
ERROR_OUT:
|
||||||
/* ensure we reset our working directory back to our default location */
|
/* ensure we reset our working directory back to our default location */
|
||||||
chdir(basedir);
|
chdir(basedir);
|
||||||
|
/* release allocated memory */
|
||||||
|
if (NULL != num_app_ctx) {
|
||||||
|
free(num_app_ctx);
|
||||||
|
}
|
||||||
|
if (NULL != npstring) {
|
||||||
|
free(npstring);
|
||||||
|
}
|
||||||
|
if (NULL != firstrankstring) {
|
||||||
|
free(firstrankstring);
|
||||||
|
}
|
||||||
/* release the event */
|
/* release the event */
|
||||||
OBJ_RELEASE(caddy);
|
OBJ_RELEASE(caddy);
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
* et Automatique. All rights reserved.
|
* et Automatique. All rights reserved.
|
||||||
* Copyright (c) 2011-2012 Los Alamos National Security, LLC.
|
* Copyright (c) 2011-2012 Los Alamos National Security, LLC.
|
||||||
* Copyright (c) 2013-2014 Intel, Inc. All rights reserved.
|
* Copyright (c) 2013-2014 Intel, Inc. All rights reserved.
|
||||||
|
* Copyright (c) 2014 Research Organization for Information Science
|
||||||
|
* and Technology (RIST). All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -521,6 +523,7 @@ void orte_plm_base_launch_apps(int fd, short args, void *cbdata)
|
|||||||
OBJ_RELEASE(caddy);
|
OBJ_RELEASE(caddy);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
OBJ_RELEASE(buffer);
|
||||||
/* maintain accounting */
|
/* maintain accounting */
|
||||||
OBJ_RELEASE(sig);
|
OBJ_RELEASE(sig);
|
||||||
|
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
|
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
|
||||||
* Copyright (c) 2008-2010 Cisco Systems, Inc. All rights reserved.
|
* Copyright (c) 2008-2010 Cisco Systems, Inc. All rights reserved.
|
||||||
* Copyright (c) 2014 Intel, Inc. All rights reserved.
|
* Copyright (c) 2014 Intel, Inc. All rights reserved.
|
||||||
|
* Copyright (c) 2014 Research Organization for Information Science
|
||||||
|
* and Technology (RIST). All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -140,6 +142,7 @@ int orte_util_check_context_app(orte_app_context_t *context, char **env)
|
|||||||
if (NULL != context->app) free(context->app);
|
if (NULL != context->app) free(context->app);
|
||||||
context->app = tmp;
|
context->app = tmp;
|
||||||
} else {
|
} else {
|
||||||
|
free(tmp);
|
||||||
if (0 != access(context->app, X_OK)) {
|
if (0 != access(context->app, X_OK)) {
|
||||||
return ORTE_ERR_EXE_NOT_ACCESSIBLE;
|
return ORTE_ERR_EXE_NOT_ACCESSIBLE;
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user