A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix bug in keyval delete
[simgrid.git]
/
src
/
smpi
/
smpi_comm.c
diff --git
a/src/smpi/smpi_comm.c
b/src/smpi/smpi_comm.c
index
2e3bf4f
..
4c02837
100644
(file)
--- a/
src/smpi/smpi_comm.c
+++ b/
src/smpi/smpi_comm.c
@@
-623,11
+623,13
@@
int smpi_comm_keyval_create(MPI_Comm_copy_attr_function* copy_fn, MPI_Comm_delet
}
int smpi_comm_keyval_free(int* keyval){
}
int smpi_comm_keyval_free(int* keyval){
- smpi_comm_key_elem elem = xbt_dict_get_or_null(smpi_comm_keyvals, (const char*)keyval);
- if(!elem)
- return MPI_ERR_ARG;
char* tmpkey=xbt_malloc(INTSIZEDCHAR);
sprintf(tmpkey, "%d", *keyval);
char* tmpkey=xbt_malloc(INTSIZEDCHAR);
sprintf(tmpkey, "%d", *keyval);
+ smpi_comm_key_elem elem = xbt_dict_get_or_null(smpi_comm_keyvals, (const char*)tmpkey);
+ if(!elem){
+ xbt_free(tmpkey);
+ return MPI_ERR_ARG;
+ }
xbt_dict_remove(smpi_comm_keyvals, (const char*)tmpkey);
xbt_free(elem);
xbt_free(tmpkey);
xbt_dict_remove(smpi_comm_keyvals, (const char*)tmpkey);
xbt_free(elem);
xbt_free(tmpkey);