Skip to content

Commit b395342

Browse files
committed
opal/datatype: reset ptypes in opal_datatype_clone()
Reset ptypes when cloning a datatype in order to prevent a double free() in the opal_datatype_t destructor. This fixes a bug introduced in 7c938f0 Fixes #6346 Signed-off-by: Gilles Gouaillardet <[email protected]>
1 parent 2cf6944 commit b395342

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

opal/datatype/opal_datatype_clone.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
* All rights reserved.
1313
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
1414
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
15+
* Copyright (c) 2019 Research Organization for Information Science
16+
* and Technology (RIST). All rights reserved.
1517
* $COPYRIGHT$
1618
*
1719
* Additional copyrights may follow
@@ -41,6 +43,7 @@ int32_t opal_datatype_clone( const opal_datatype_t * src_type, opal_datatype_t *
4143
sizeof(opal_datatype_t)-sizeof(opal_object_t) );
4244

4345
dest_type->flags &= (~OPAL_DATATYPE_FLAG_PREDEFINED);
46+
dest_type->ptypes = NULL;
4447
dest_type->desc.desc = temp;
4548

4649
/**

0 commit comments

Comments
 (0)