pmix: fix misc memory leaks
as reported by Coverity as CID 1269843, 1269854, 1269856, 1269857 and 1269858
Этот коммит содержится в:
родитель
ccbdf64de4
Коммит
0ce59f2d29
@ -3,7 +3,7 @@
|
||||
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2014 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014 Research Organization for Information Science
|
||||
* Copyright (c) 2014-2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
@ -171,6 +171,7 @@ int opal_pmix_base_commit_packed( char** data, int* data_offset,
|
||||
if (OPAL_SUCCESS != rc) {
|
||||
*pack_key = pkey;
|
||||
free(tmp);
|
||||
free(encoded_data);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -187,6 +188,7 @@ int opal_pmix_base_commit_packed( char** data, int* data_offset,
|
||||
memcpy(tmp+*enc_data_offset, encoded_data, encoded_data_len+1);
|
||||
tmp[*enc_data_offset+encoded_data_len+1] = '\0';
|
||||
tmp[*enc_data_offset+encoded_data_len] = '-';
|
||||
free(encoded_data);
|
||||
|
||||
sprintf (tmp_key, "key%d", pkey);
|
||||
|
||||
@ -206,7 +208,6 @@ int opal_pmix_base_commit_packed( char** data, int* data_offset,
|
||||
}
|
||||
|
||||
pkey++;
|
||||
free(encoded_data);
|
||||
free(*data);
|
||||
*data = NULL;
|
||||
*data_offset = 0;
|
||||
@ -272,6 +273,7 @@ int opal_pmix_base_partial_commit_packed( char** data, int* data_offset,
|
||||
if (OPAL_SUCCESS != rc) {
|
||||
*pack_key = pkey;
|
||||
free(tmp);
|
||||
free(encoded_data);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -316,6 +318,10 @@ int opal_pmix_base_get_packed(const opal_process_name_t* proc, char **packed_dat
|
||||
if (NULL == (pmikey = setup_key(proc, tmp_key, vallen))) {
|
||||
rc = OPAL_ERR_OUT_OF_RESOURCE;
|
||||
OPAL_ERROR_LOG(rc);
|
||||
free(pmi_tmp);
|
||||
if (NULL != tmp_encoded) {
|
||||
free(tmp_encoded);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014 Research Organization for Information Science
|
||||
* Copyright (c) 2014-2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2014 Mellanox Technologies, Inc.
|
||||
* All rights reserved.
|
||||
@ -216,10 +216,12 @@ static int native_init(void)
|
||||
mca_pmix_native_component.address.sun_family = AF_UNIX;
|
||||
uri = opal_argv_split(mca_pmix_native_component.uri, ':');
|
||||
if (2 != opal_argv_count(uri)) {
|
||||
opal_argv_free(uri);
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
/* if the rendezvous file doesn't exist, that's an error */
|
||||
if (0 != access(uri[1], R_OK)) {
|
||||
opal_argv_free(uri);
|
||||
return OPAL_ERR_NOT_FOUND;
|
||||
}
|
||||
opal_convert_string_to_process_name(&mca_pmix_native_component.server, uri[0]);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user