1
1
as reported by Coverity as CID 1269843, 1269854, 1269856, 1269857 and 1269858
Этот коммит содержится в:
Gilles Gouaillardet 2015-02-16 11:19:43 +09:00
родитель ccbdf64de4
Коммит 0ce59f2d29
2 изменённых файлов: 11 добавлений и 3 удалений

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

@ -3,7 +3,7 @@
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights * Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
* reserved. * 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 * Copyright (c) 2014-2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
@ -171,6 +171,7 @@ int opal_pmix_base_commit_packed( char** data, int* data_offset,
if (OPAL_SUCCESS != rc) { if (OPAL_SUCCESS != rc) {
*pack_key = pkey; *pack_key = pkey;
free(tmp); free(tmp);
free(encoded_data);
return rc; 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); 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+1] = '\0';
tmp[*enc_data_offset+encoded_data_len] = '-'; tmp[*enc_data_offset+encoded_data_len] = '-';
free(encoded_data);
sprintf (tmp_key, "key%d", pkey); sprintf (tmp_key, "key%d", pkey);
@ -206,7 +208,6 @@ int opal_pmix_base_commit_packed( char** data, int* data_offset,
} }
pkey++; pkey++;
free(encoded_data);
free(*data); free(*data);
*data = NULL; *data = NULL;
*data_offset = 0; *data_offset = 0;
@ -272,6 +273,7 @@ int opal_pmix_base_partial_commit_packed( char** data, int* data_offset,
if (OPAL_SUCCESS != rc) { if (OPAL_SUCCESS != rc) {
*pack_key = pkey; *pack_key = pkey;
free(tmp); free(tmp);
free(encoded_data);
return rc; 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))) { if (NULL == (pmikey = setup_key(proc, tmp_key, vallen))) {
rc = OPAL_ERR_OUT_OF_RESOURCE; rc = OPAL_ERR_OUT_OF_RESOURCE;
OPAL_ERROR_LOG(rc); OPAL_ERROR_LOG(rc);
free(pmi_tmp);
if (NULL != tmp_encoded) {
free(tmp_encoded);
}
return rc; return rc;
} }

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

@ -1,7 +1,7 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/* /*
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved. * 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. * and Technology (RIST). All rights reserved.
* Copyright (c) 2014 Mellanox Technologies, Inc. * Copyright (c) 2014 Mellanox Technologies, Inc.
* All rights reserved. * All rights reserved.
@ -216,10 +216,12 @@ static int native_init(void)
mca_pmix_native_component.address.sun_family = AF_UNIX; mca_pmix_native_component.address.sun_family = AF_UNIX;
uri = opal_argv_split(mca_pmix_native_component.uri, ':'); uri = opal_argv_split(mca_pmix_native_component.uri, ':');
if (2 != opal_argv_count(uri)) { if (2 != opal_argv_count(uri)) {
opal_argv_free(uri);
return OPAL_ERROR; return OPAL_ERROR;
} }
/* if the rendezvous file doesn't exist, that's an error */ /* if the rendezvous file doesn't exist, that's an error */
if (0 != access(uri[1], R_OK)) { if (0 != access(uri[1], R_OK)) {
opal_argv_free(uri);
return OPAL_ERR_NOT_FOUND; return OPAL_ERR_NOT_FOUND;
} }
opal_convert_string_to_process_name(&mca_pmix_native_component.server, uri[0]); opal_convert_string_to_process_name(&mca_pmix_native_component.server, uri[0]);