diff --git a/ompi/mca/btl/sctp/btl_sctp_component.c b/ompi/mca/btl/sctp/btl_sctp_component.c index ac164c3c3d..e7cf50b88b 100644 --- a/ompi/mca/btl/sctp/btl_sctp_component.c +++ b/ompi/mca/btl/sctp/btl_sctp_component.c @@ -10,6 +10,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -492,8 +493,12 @@ static int mca_btl_sctp_component_create_instance(void) return OMPI_ERROR; } - /* allocate memory for btl */ - mca_btl_sctp_component.sctp_btls = (mca_btl_sctp_module_t **)malloc(sizeof(mca_btl_sctp_module_t*)); + /* Allocate memory for btl pointers. This may be more space then + we need as some of the interfaces may get filtered out by the + if_include and if_exclude parameters. But that is just a few + unused pointers. */ + mca_btl_sctp_component.sctp_btls = + (mca_btl_sctp_module_t **)malloc(if_count * sizeof(mca_btl_sctp_module_t*)); if(NULL == mca_btl_sctp_component.sctp_btls) { return OMPI_ERR_OUT_OF_RESOURCE; } diff --git a/ompi/mca/btl/sctp/btl_sctp_utils.c b/ompi/mca/btl/sctp/btl_sctp_utils.c index 43170e0799..918acef6ae 100644 --- a/ompi/mca/btl/sctp/btl_sctp_utils.c +++ b/ompi/mca/btl/sctp/btl_sctp_utils.c @@ -9,6 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. + * Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -23,6 +24,7 @@ #include "btl_sctp_utils.h" +#include "ompi/mca/btl/base/btl_base_error.h" /** * struct sockaddr_in mca_btl_sctp_utils_sockaddr_from_frag