From a01f3f762c627941dbc6d9d3958aa31f2fe635be Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Tue, 25 Mar 2008 22:43:46 +0000 Subject: [PATCH] Check if extra is NULL or not ... This commit was SVN r17967. --- ompi/debuggers/ompi_msgq_dll.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/ompi/debuggers/ompi_msgq_dll.c b/ompi/debuggers/ompi_msgq_dll.c index bfddecd7d4..00b2cd478e 100644 --- a/ompi/debuggers/ompi_msgq_dll.c +++ b/ompi/debuggers/ompi_msgq_dll.c @@ -1231,19 +1231,22 @@ void mqs_destroy_process_info (mqs_process_info *mp_info) mpi_process_info *p_info = (mpi_process_info *)mp_info; mpi_process_info_extra *extra = (mpi_process_info_extra*) p_info->extra; /* Need to handle the communicators and groups too */ - communicator_t *comm = extra->communicator_list; + communicator_t *comm; - while (comm) { - communicator_t *next = comm->next; - - if( NULL != comm->group ) - group_decref (comm->group); /* Group is no longer referenced from here */ - mqs_free (comm); - - comm = next; - } - if (NULL != extra) { - mqs_free(extra); + if( NULL != extra) { + comm = extra->communicator_list; + while (comm) { + communicator_t *next = comm->next; + + if( NULL != comm->group ) + group_decref (comm->group); /* Group is no longer referenced from here */ + mqs_free (comm); + + comm = next; + } + if (NULL != extra) { + mqs_free(extra); + } } mqs_free (p_info); } /* mqs_destroy_process_info */