Intel® Inspector User Guide for Windows* OS

ID 767798
Date 10/31/2024
Public
Document Table of Contents

Kernel Resource Leak

Occurs when a kernel object handle is created but never closed.

ID

Code Location

Description

1

Creation site

Represents the location and associated call stack from which the handle was created.

C Example

HANDLE hThread = CreateThread(0, 8192, work0, NULL, 0, NULL);
return;

Fortran Example

ThreadHandle = CreateThread(security, stack_size, Thread_Proc,loc(ivalue), 
CREATE_SUSPENDED, thread_id)
   end

Possible Correction Strategies

Use the appropriate function to close the handle after use.

Creation Function

Close Function

BeginUpdateResource

EndUpdateResource

CreateConsoleScreenBuffer

CloseHandle

CreateEvent, OpenEvent

CloseHandle

CreateFile, ReOpenFile

CloseHandle

CreateFileMapping, OpenFileMapping

CloseHandle