1
1

pmix/base: plug a memory leak in opal_pmix_base_select()

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>

(cherry picked from commit open-mpi/ompi@6e47c5708e)
Этот коммит содержится в:
Gilles Gouaillardet 2018-05-21 13:35:21 +09:00
родитель 71d3afdc59
Коммит 8015e6f929

Просмотреть файл

@ -4,6 +4,8 @@
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights * Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved. * reserved.
* Copyright (c) 2016-2018 Cisco Systems, Inc. All rights reserved * Copyright (c) 2016-2018 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -19,6 +21,7 @@
#include "opal/mca/base/base.h" #include "opal/mca/base/base.h"
#include "opal/mca/pmix/pmix.h" #include "opal/mca/pmix/pmix.h"
#include "opal/mca/pmix/base/base.h" #include "opal/mca/pmix/base/base.h"
#include "opal/util/opal_environ.h"
/* /*
* Globals * Globals
@ -33,11 +36,8 @@ int opal_pmix_base_select(void)
// value of OPAL's mca_base_component_show_load_errors (i.e., the // value of OPAL's mca_base_component_show_load_errors (i.e., the
// bool variable behind Open MPI's mca_component_show_load_errors // bool variable behind Open MPI's mca_component_show_load_errors
// MCA param). // MCA param).
char *pmix_show_load_errors_env = NULL; char *pmix_show_load_errors_env = mca_base_component_show_load_errors ? "1" : "0";
asprintf(&pmix_show_load_errors_env, opal_setenv("PMIX_MCA_mca_base_component_show_load_errors", pmix_show_load_errors_env, true, &environ);
"PMIX_MCA_mca_base_component_show_load_errors=%d",
mca_base_component_show_load_errors ? 1 : 0);
putenv(pmix_show_load_errors_env);
/* /*
* Select the best component * Select the best component