diff --git a/src/mpi/attr/attrutil.c b/src/mpi/attr/attrutil.c index b9abbe6..5af452a 100644 --- a/src/mpi/attr/attrutil.c +++ b/src/mpi/attr/attrutil.c @@ -266,6 +266,7 @@ int MPIR_Attr_delete_list( int handle, MPID_Attribute **attr ) corresponding keyval */ /* Still to do: capture any error returns but continue to process attributes */ + if (p->keyval) { mpi_errno = MPIR_Call_attr_delete( handle, p ); /* We must also remove the keyval reference. If the keyval @@ -282,6 +283,7 @@ int MPIR_Attr_delete_list( int handle, MPID_Attribute **attr ) MPIU_Handle_obj_free( &MPID_Keyval_mem, p->keyval ); } } + } MPIU_Handle_obj_free( &MPID_Attr_mem, p );