-
Notifications
You must be signed in to change notification settings - Fork 937
Fixing memory leaks as reported by valgrind #8747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 */ | ||
| if (!mca_common_monitoring_enabled) { | ||
| if (NULL != mca_common_monitoring_current_filename) { | ||
| free(mca_common_monitoring_current_filename); | ||
| mca_common_monitoring_current_filename = NULL; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 */ | ||
|
|
@@ -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; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 */ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.310?