Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions ompi/mca/common/monitoring/common_monitoring.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,18 @@ int mca_common_monitoring_init( void )

void mca_common_monitoring_finalize( void )
{
if( ! mca_common_monitoring_enabled || /* Don't release if not last */
0 < opal_atomic_sub_fetch_32(&mca_common_monitoring_hold, 1) ) return;
/* Even if not enabled, this string is allocated at l.310 */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.310?

if (!mca_common_monitoring_enabled) {
if (NULL != mca_common_monitoring_current_filename) {
free(mca_common_monitoring_current_filename);
mca_common_monitoring_current_filename = NULL;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this file closed?

}
return;
}

/* Don't release if not last */
if (0 < opal_atomic_sub_fetch_32(&mca_common_monitoring_hold, 1))
return;

OPAL_MONITORING_PRINT_INFO("common_component_finish");
/* Dump monitoring informations */
Expand All @@ -245,11 +255,11 @@ void mca_common_monitoring_finalize( void )
opal_output_close(mca_common_monitoring_output_stream_id);
free(mca_common_monitoring_output_stream_obj.lds_prefix);
/* Free internal data structure */
free((void *) pml_data); /* a single allocation */
opal_hash_table_remove_all( common_monitoring_translation_ht );
free(pml_data); /* a single allocation */
opal_hash_table_remove_all(common_monitoring_translation_ht);
OBJ_RELEASE(common_monitoring_translation_ht);
mca_common_monitoring_coll_finalize();
if( NULL != mca_common_monitoring_current_filename ) {
if (NULL != mca_common_monitoring_current_filename) {
free(mca_common_monitoring_current_filename);
mca_common_monitoring_current_filename = NULL;
}
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/mtl/ofi/mtl_ofi.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ ompi_mtl_ofi_add_procs(struct mca_mtl_base_module_t *mtl,
goto bail;
}
memcpy(&ep_names[i*namelen], ep_name, namelen);
free(ep_name); // malloc'd inside OFI_COMPAT_MODEX_RECV in pmix3x.c:1097
}

/**
Expand Down
6 changes: 6 additions & 0 deletions ompi/mca/mtl/ofi/mtl_ofi_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,12 @@ ompi_mtl_ofi_finalize(struct mca_mtl_base_module_t *mtl)
free(ompi_mtl_ofi.comm_to_context);
free(ompi_mtl_ofi.ofi_ctxt);

/* This was strdup()ed at L.714 */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this is 1024. but having line numbers is always dicey. I'd say remove the line reference.

if (NULL != ompi_mtl_ofi.provider_name) {
free(ompi_mtl_ofi.provider_name);
ompi_mtl_ofi.provider_name = NULL;
}

return OMPI_SUCCESS;

finalize_err:
Expand Down
2 changes: 1 addition & 1 deletion opal/mca/mpool/hugepage/mpool_hugepage_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ static void mca_mpool_hugepage_find_hugepages(void)
"found huge page with size = %lu, path = %s, mmap flags = 0x%x, with invalid "
"permissions, skipping",
hp->page_size, hp->path, hp->mmap_flags);
OBJ_RELEASE(hp);
}
OBJ_RELEASE(hp);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like hp->path is leaked on line 274.

}

opal_list_sort(&mca_mpool_hugepage_component.huge_pages, page_compare);
Expand Down