diff options
author | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2015-10-30 20:24:25 +0000 |
---|---|---|
committer | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2015-10-30 20:24:25 +0000 |
commit | 57d171c9a6bde7c4cd5de0edddba2c89a1cdf2d5 (patch) | |
tree | 90f2d8ebb4b07ac9743a7f0e18f488346afbbb0a /openmp/runtime/src | |
parent | 1543bdf4509c9001fd635fe24204b6d429603ff4 (diff) | |
download | bcm5719-llvm-57d171c9a6bde7c4cd5de0edddba2c89a1cdf2d5.tar.gz bcm5719-llvm-57d171c9a6bde7c4cd5de0edddba2c89a1cdf2d5.zip |
[OMPT] Adding missing free() calls to ompt_tool_windows() function.
llvm-svn: 251719
Diffstat (limited to 'openmp/runtime/src')
-rw-r--r-- | openmp/runtime/src/ompt-general.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/openmp/runtime/src/ompt-general.c b/openmp/runtime/src/ompt-general.c index 88f2d2e8f66..9b6ab076ca2 100644 --- a/openmp/runtime/src/ompt-general.c +++ b/openmp/runtime/src/ompt-general.c @@ -137,6 +137,7 @@ ompt_initialize_t ompt_tool_windows() if( !EnumProcessModules( process, modules, NUM_MODULES * sizeof(HMODULE), &needed ) ) { // Regardless of the error reason use the stub initialization function + free(modules); return NULL; } // Check if NUM_MODULES is enough to list all modules @@ -148,6 +149,7 @@ ompt_initialize_t ompt_tool_windows() modules = (HMODULE*)realloc( modules, needed ); // If resizing failed use the stub function. if( !EnumProcessModules( process, modules, needed, &needed ) ) { + free(modules); return NULL; } } @@ -160,6 +162,7 @@ ompt_initialize_t ompt_tool_windows() printf("ompt_tool_windows(): ompt_tool found in module %s\n", modName); #endif + free(modules); return ompt_tool_p(); } #if OMPT_DEBUG @@ -171,6 +174,7 @@ ompt_initialize_t ompt_tool_windows() } #endif } + free(modules); return NULL; } #else |